How to simulate dynamic requests per minute in JMeter where numbers come
from file for each minute
After successfully using JMeter to profile our platform's performance I
got the request to simulate a 24h load based on minute-by-minute
transaction data extracted from the last year's logs.
At this point, having the static nature of thread creation in jmeter I am
wondering if this is easily achievable. I studied the usual plugins
together with those at jmeter-plugins.org but still I could not find a
straightforward way to do this kind of shaping.
I am looking at the alternative to write a groovy script that takes
control of thread creation but I am not sure if this is the proper way to
go.
Any suggestions?
Thanks, Dikran
Boman
Thursday, 3 October 2013
Wednesday, 2 October 2013
AHK utilman script gives file not found error
AHK utilman script gives file not found error
I'm trying to create a simple backdoor for myself through utilman on my
computer using autohotkey. Basically I want to have the ease of access
button function normally in all cases on login screen Except when I hold
down the M key, where in this case it opens cmd instead. No batch or cmd
window should pop up, and one doesn't. The issue I'm having is that I get
a file not found error from the script, I compiled the script into
Utilman.exe and tested with a copy of the real utilman (renamed to lol.exe
which is specified in the script to run normally) and this works fine in
its own directory. However when I do this in the system32 folder it gives
an error that lol.exe is not found, also executing lol.exe on it's own
gives the exact same error, as if it reroutes to the script named Utilman
yet again. Here is the script, should be short and simple:
SetWorkingDir %A_ScriptDir%
Sleep 400
GetKeyState, state, m
if state = D
Run cmd.exe
else
Run lol.exe
Sleep 200
ExitApp
Thanks for any pointers, alternative suggestions or ideas. This would be
great to get working.
EDIT: Changing Run lol.exe to Run, "C:\Windows\System32\lol.exe" now gives
instead an exe corrupted error. This also happens if I run lol.exe on it's
own, I'm really not sure what's happening.
I'm trying to create a simple backdoor for myself through utilman on my
computer using autohotkey. Basically I want to have the ease of access
button function normally in all cases on login screen Except when I hold
down the M key, where in this case it opens cmd instead. No batch or cmd
window should pop up, and one doesn't. The issue I'm having is that I get
a file not found error from the script, I compiled the script into
Utilman.exe and tested with a copy of the real utilman (renamed to lol.exe
which is specified in the script to run normally) and this works fine in
its own directory. However when I do this in the system32 folder it gives
an error that lol.exe is not found, also executing lol.exe on it's own
gives the exact same error, as if it reroutes to the script named Utilman
yet again. Here is the script, should be short and simple:
SetWorkingDir %A_ScriptDir%
Sleep 400
GetKeyState, state, m
if state = D
Run cmd.exe
else
Run lol.exe
Sleep 200
ExitApp
Thanks for any pointers, alternative suggestions or ideas. This would be
great to get working.
EDIT: Changing Run lol.exe to Run, "C:\Windows\System32\lol.exe" now gives
instead an exe corrupted error. This also happens if I run lol.exe on it's
own, I'm really not sure what's happening.
Error Serializing Observable Collection Windows Store
Error Serializing Observable Collection Windows Store
I have an observable collection I am trying to serialize to disk. The
error that is received is :
Type 'VisuallySpeaking.Data.GrammarList' with data contract name
'GrammarList:http://schemas.datacontract.org/2004/07/VisuallySpeaking.Data'
is not expected. Consider using a DataContractResolver or add any types
not known statically to the list of known types - for example, by using
the KnownTypeAttribute attribute or by adding them to the list of known
types passed to DataContractSerializer."} System.Exception
{System.Runtime.Serialization.SerializationException}
Here is my data object:
namespace VisuallySpeaking.Data
{
[CollectionDataContract]
public class GrammarList : ObservableCollection<GrammarDataObject>
{
public GrammarList() : base()
{
Add(new GrammarDataObject("My Name", "My name
is","Assets/SampleAssets/MyName.png"));
Add(new GrammarDataObject("Where is", "Where is",""));
Add(new GrammarDataObject("Dog", "I have a
dog","/Assets/SampleAssets/westie.jpg"));
}
}
[DataContract]
public class GrammarDataObject : VisuallySpeaking.Common.BindableBase
{
private string _Name;
private string _SpeakingText;
private string _ImagePath;
public GrammarDataObject(string Name, string SpeakingText, string
ImagePath)
{
this.Name = Name;
this.SpeakingText = SpeakingText;
this.ImagePath = ImagePath;
}
[DataMember]
public string Name
{
get { return _Name; }
set
{
if (this._Name != value)
{
this._Name = value;
this.OnPropertyChanged("Name");
}
}
}
[DataMember]
public string SpeakingText
{
get { return _SpeakingText; }
set
{
if (this._SpeakingText != value)
{
this._SpeakingText = value;
this.OnPropertyChanged("SpeakingText");
}
}
}
[DataMember]
public string ImagePath
{
get { return _ImagePath; }
set
{
if (this._ImagePath != value)
{
this._ImagePath = value;
this.OnPropertyChanged("ImagePath");
}
}
}
}
I assume that I have somehow marked my GrammarList class incorrectly, but
it escapes me as to how to resolve.
Thanks!
I have an observable collection I am trying to serialize to disk. The
error that is received is :
Type 'VisuallySpeaking.Data.GrammarList' with data contract name
'GrammarList:http://schemas.datacontract.org/2004/07/VisuallySpeaking.Data'
is not expected. Consider using a DataContractResolver or add any types
not known statically to the list of known types - for example, by using
the KnownTypeAttribute attribute or by adding them to the list of known
types passed to DataContractSerializer."} System.Exception
{System.Runtime.Serialization.SerializationException}
Here is my data object:
namespace VisuallySpeaking.Data
{
[CollectionDataContract]
public class GrammarList : ObservableCollection<GrammarDataObject>
{
public GrammarList() : base()
{
Add(new GrammarDataObject("My Name", "My name
is","Assets/SampleAssets/MyName.png"));
Add(new GrammarDataObject("Where is", "Where is",""));
Add(new GrammarDataObject("Dog", "I have a
dog","/Assets/SampleAssets/westie.jpg"));
}
}
[DataContract]
public class GrammarDataObject : VisuallySpeaking.Common.BindableBase
{
private string _Name;
private string _SpeakingText;
private string _ImagePath;
public GrammarDataObject(string Name, string SpeakingText, string
ImagePath)
{
this.Name = Name;
this.SpeakingText = SpeakingText;
this.ImagePath = ImagePath;
}
[DataMember]
public string Name
{
get { return _Name; }
set
{
if (this._Name != value)
{
this._Name = value;
this.OnPropertyChanged("Name");
}
}
}
[DataMember]
public string SpeakingText
{
get { return _SpeakingText; }
set
{
if (this._SpeakingText != value)
{
this._SpeakingText = value;
this.OnPropertyChanged("SpeakingText");
}
}
}
[DataMember]
public string ImagePath
{
get { return _ImagePath; }
set
{
if (this._ImagePath != value)
{
this._ImagePath = value;
this.OnPropertyChanged("ImagePath");
}
}
}
}
I assume that I have somehow marked my GrammarList class incorrectly, but
it escapes me as to how to resolve.
Thanks!
Two vertical child elements need to fit 100% height of parent, both dynamic heights
Two vertical child elements need to fit 100% height of parent, both
dynamic heights
I have a feeling that this might not be possible, but I'm hoping someone
will prove me wrong.
I have a parent element of a non-fixed height (although it could be, I
don't think it helps). Within it are two children, stacked vertically. The
height of the first item is unknowable. I'd like the second item to take
up the remaining height.
HTML:
<div class="container">
<a class="snippet" href="#">
<img class="example-image" src="example-image.png">
<div class="snippet-text-section">
<div class="snippet-title">Title for the item - could be one or two
lines long</div>
<div class="snippet-text">Rest of the text, filling the remaining
space.</div>
</div>
</a>
</div>
CSS:
* {
padding: 0;
margin: 0;
}
.container{
position:relative;
}
.snippet {
display: block;
border-radius: 5px;
background-color: #ddd;
color:black;
overflow:hidden;
}
img {
max-width: 100%;
vertical-align: middle;
display: inline-block;
height:100px;
}
.example-image {
width: 100%;
background-color: #111;
}
.date {
position: absolute;
top: -20px;
background-color: #1b1f52;
font-weight: bold;
padding:0px 2px;
color: white;
}
.snippet-text-section {
padding: 0px 20px 20px 0px;
position: absolute;
top: 0;
width: 100%;
height: 100%;
}
.snippet-title {
margin-bottom: 0;
font-size: 14px;
font-weight: 700;
background-color: rgba(255,0,0,0.8);
color: white;
padding: 0 5px;
border-radius: 0px 5px 0px 0px;
}
.snippet-text {
font-size: 20px;
line-height: 25px;
background-color: rgba(0,0,255,0.8);
color: white;
height: 100%;
padding: 0 5px;
border-radius: 0px 0px 5px 5px;
}
Please note I've looked at a lot of posts on here. Most similar ones deal
with the child divs having a horizontal layout. The closest I've come to a
solution (and what I'm currently using) is Two vertical divs within a 100%
height div where I'm forcing the height of the first child, but it's not
ideal.
I'm currently wondering if there's a table-layout solution I've missed...
dynamic heights
I have a feeling that this might not be possible, but I'm hoping someone
will prove me wrong.
I have a parent element of a non-fixed height (although it could be, I
don't think it helps). Within it are two children, stacked vertically. The
height of the first item is unknowable. I'd like the second item to take
up the remaining height.
HTML:
<div class="container">
<a class="snippet" href="#">
<img class="example-image" src="example-image.png">
<div class="snippet-text-section">
<div class="snippet-title">Title for the item - could be one or two
lines long</div>
<div class="snippet-text">Rest of the text, filling the remaining
space.</div>
</div>
</a>
</div>
CSS:
* {
padding: 0;
margin: 0;
}
.container{
position:relative;
}
.snippet {
display: block;
border-radius: 5px;
background-color: #ddd;
color:black;
overflow:hidden;
}
img {
max-width: 100%;
vertical-align: middle;
display: inline-block;
height:100px;
}
.example-image {
width: 100%;
background-color: #111;
}
.date {
position: absolute;
top: -20px;
background-color: #1b1f52;
font-weight: bold;
padding:0px 2px;
color: white;
}
.snippet-text-section {
padding: 0px 20px 20px 0px;
position: absolute;
top: 0;
width: 100%;
height: 100%;
}
.snippet-title {
margin-bottom: 0;
font-size: 14px;
font-weight: 700;
background-color: rgba(255,0,0,0.8);
color: white;
padding: 0 5px;
border-radius: 0px 5px 0px 0px;
}
.snippet-text {
font-size: 20px;
line-height: 25px;
background-color: rgba(0,0,255,0.8);
color: white;
height: 100%;
padding: 0 5px;
border-radius: 0px 0px 5px 5px;
}
Please note I've looked at a lot of posts on here. Most similar ones deal
with the child divs having a horizontal layout. The closest I've come to a
solution (and what I'm currently using) is Two vertical divs within a 100%
height div where I'm forcing the height of the first child, but it's not
ideal.
I'm currently wondering if there's a table-layout solution I've missed...
Taking ddms logs through an application
Taking ddms logs through an application
Thanks in Advance!!
My requirement is to take ddms logs on click of a button in an app, and
save the file in sdcard.
I am able to do this through following code:
logbtn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
int ret = DoShellCmd("logcat -d > /sdcard/log_" +
sysdump_time + ".log");
Log.i(LOG_TAG, "returned value"+ret);
}
});
thread.start();
}
});
}
int DoShellCmd(String cmd) {
//isDumpstateRunning = true;
Log.i(LOG_TAG, "DoShellCmd : " + cmd);
Process p = null;
String[] shell_command = {
"/system/bin/sh", "-c",cmd
};
try {
Log.i(LOG_TAG, "exec command");
p = Runtime.getRuntime().exec(shell_command);
p.waitFor();
Log.i(LOG_TAG, "exec done");
} catch (IOException exception) {
Log.e(LOG_TAG, "DoShellCmd - IOException");
return -1;
} catch (SecurityException exception) {
Log.e(LOG_TAG, "DoShellCmd - SecurityException");
return -1;
} catch (InterruptedException e) {
e.printStackTrace();
return -1;
}
Log.i(LOG_TAG, "DoShellCmd done: " + cmd);
return 1;
}
Though the log file is generated , but complete logs are not appeared.
Only some logs appears. Any help will be appreciated.
Thanks in Advance!!
My requirement is to take ddms logs on click of a button in an app, and
save the file in sdcard.
I am able to do this through following code:
logbtn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
int ret = DoShellCmd("logcat -d > /sdcard/log_" +
sysdump_time + ".log");
Log.i(LOG_TAG, "returned value"+ret);
}
});
thread.start();
}
});
}
int DoShellCmd(String cmd) {
//isDumpstateRunning = true;
Log.i(LOG_TAG, "DoShellCmd : " + cmd);
Process p = null;
String[] shell_command = {
"/system/bin/sh", "-c",cmd
};
try {
Log.i(LOG_TAG, "exec command");
p = Runtime.getRuntime().exec(shell_command);
p.waitFor();
Log.i(LOG_TAG, "exec done");
} catch (IOException exception) {
Log.e(LOG_TAG, "DoShellCmd - IOException");
return -1;
} catch (SecurityException exception) {
Log.e(LOG_TAG, "DoShellCmd - SecurityException");
return -1;
} catch (InterruptedException e) {
e.printStackTrace();
return -1;
}
Log.i(LOG_TAG, "DoShellCmd done: " + cmd);
return 1;
}
Though the log file is generated , but complete logs are not appeared.
Only some logs appears. Any help will be appreciated.
Tuesday, 1 October 2013
Can I use different workflows simultaneously in F#?
Can I use different workflows simultaneously in F#?
I need my state to be passed along while being able to chain functions
with the maybe workflow. Is there a way for 2 workflows to be within the
same context? If no, what is the way of doing it?
I need my state to be passed along while being able to chain functions
with the maybe workflow. Is there a way for 2 workflows to be within the
same context? If no, what is the way of doing it?
Doctrine many to one relation with no additional key
Doctrine many to one relation with no additional key
I've made some projects with many-to-one/many relations, foreign keys etc
in doctrine and they all worked well. At least as long as I could join
them by id and some other index.
This time I have a table with invoices and another table with company
addresses etc. A simplified Invoice.orm.yml looks like this:
uniqueConstraints:
event_user_idx:
columns: seller,number
manyToOne:
companyData:
targetEntity: CompanyData
joinColumns:
seller:
referencedColumnName: vatNo
fields:
id:
type: integer
id: true
generator:
strategy: AUTO
seller:
type: string
length: '16'
number:
type: string
length: '32'
while CompanyData.orm.yml looks like this:
indexes:
nip:
columns: [ nip ]
fields:
id:
type: integer
id: true
generator:
strategy: AUTO
name:
type: string
length: '128'
vatNo:
type: string
length: '16'
Usually I would just add a new field to Invoices, like 'company_id' and
everything would (most likely) work well. However, as vatNo is a unique
number (as there are no two companies with the same vat number) I don't
want to create necessary artificial keys. So I've made a unidirectional
many-to-one mapping as above. Everything works well when I get data from
the database. I can make a query like this:
SELECT f, c
FROM MyBundle:Invoices i
LEFT JOIN i.companyData c
WHERE f.seller = :seller
and get all the invoices with companies related to it. However, there's a
problem with adding new entities to the database - after adding a foreign
key, I can no longer change the 'seller' field. I tried
$invoice->setSeller('some string')
and
$invoice->setCompanyData($companyData) //some CompanyData object fetched
from DB
it is set to null anyway. While 'seller' is not nullable, I get an exception.
I've tried to change the mapping to:
manyToOne:
companyData:
targetEntity: CompanyData
joinColumns:
seller_other_column:
referencedColumnName: vatNo
and then the query was successful, but the seller_other_column was set to
null anyway. Another strange thing is that when I call
echo $invoice->getSeller();
print_r($invoice->getCompanyData());
$em->persist($invoice);
$em->flush();
it displays the proper data (vat number and CompanyData object), but these
data are nulled anyway, before saving to the database.
Do you have any idea what's wrong?
I've made some projects with many-to-one/many relations, foreign keys etc
in doctrine and they all worked well. At least as long as I could join
them by id and some other index.
This time I have a table with invoices and another table with company
addresses etc. A simplified Invoice.orm.yml looks like this:
uniqueConstraints:
event_user_idx:
columns: seller,number
manyToOne:
companyData:
targetEntity: CompanyData
joinColumns:
seller:
referencedColumnName: vatNo
fields:
id:
type: integer
id: true
generator:
strategy: AUTO
seller:
type: string
length: '16'
number:
type: string
length: '32'
while CompanyData.orm.yml looks like this:
indexes:
nip:
columns: [ nip ]
fields:
id:
type: integer
id: true
generator:
strategy: AUTO
name:
type: string
length: '128'
vatNo:
type: string
length: '16'
Usually I would just add a new field to Invoices, like 'company_id' and
everything would (most likely) work well. However, as vatNo is a unique
number (as there are no two companies with the same vat number) I don't
want to create necessary artificial keys. So I've made a unidirectional
many-to-one mapping as above. Everything works well when I get data from
the database. I can make a query like this:
SELECT f, c
FROM MyBundle:Invoices i
LEFT JOIN i.companyData c
WHERE f.seller = :seller
and get all the invoices with companies related to it. However, there's a
problem with adding new entities to the database - after adding a foreign
key, I can no longer change the 'seller' field. I tried
$invoice->setSeller('some string')
and
$invoice->setCompanyData($companyData) //some CompanyData object fetched
from DB
it is set to null anyway. While 'seller' is not nullable, I get an exception.
I've tried to change the mapping to:
manyToOne:
companyData:
targetEntity: CompanyData
joinColumns:
seller_other_column:
referencedColumnName: vatNo
and then the query was successful, but the seller_other_column was set to
null anyway. Another strange thing is that when I call
echo $invoice->getSeller();
print_r($invoice->getCompanyData());
$em->persist($invoice);
$em->flush();
it displays the proper data (vat number and CompanyData object), but these
data are nulled anyway, before saving to the database.
Do you have any idea what's wrong?
Subscribe to:
Comments (Atom)