artillery not reporting request latency - ruby-on-rails

I am running an artillery load test on a simple Rails ActiveCable app:
config:
target: "ws://localhost:3000/cable"
phases:
- duration: 10 # seconds
arrivalRate: 1 # virtual users per second
name: "Ramping up the load"
scenarios:
- engine: "ws"
flow:
- send:
{
command: "subscribe",
identifier: '{"channel":"RoomChannel","room_id":"4"}',
}
- think: 60
I was expecting artillery to report something like what I have seen in examples like this:
All virtual users finished
Summary report # 12:20:49(-0700) 2019-09-11
Scenarios launched: 5
Scenarios completed: 5
Requests completed: 15
RPS sent: 2.01
Request latency:
min: 1001
max: 3009.7
median: 2005.8
p95: 3009.3
p99: 3009.7
but instead I am getting something like
vusers.completed: .............................................................. 10
vusers.created: ................................................................ 10
vusers.created_by_name.0: ...................................................... 10
vusers.failed: ................................................................. 0
vusers.session_length:
min: ......................................................................... 60009.2
max: ......................................................................... 60028.2
median: ...................................................................... 60495.1
p95: ......................................................................... 60495.1
p99: ......................................................................... 60495.1
websocket.messages_sent: ....................................................... 10
websocket.send_rate: ........................................................... 1/sec
What do I need to do to get artillery to report latency?

Related

Slow results from Microsoft Graph's list_attachments API and occasionally returns an error

The list_attachments API is slow to respond and sometimes returns an error message with neither a code nor a description.
To time the API's response, I triggered it 20 times and then recorded the total time and time per API call, both in seconds.
PFB the python script used to test the list attachments API.
# Initialize variables to track error and success
error_count = 0
success_count = 0
# Allow token scope to not match requested scope. (Other auth libraries allow
# this, but Requests-OAuthlib raises an exception on scope mismatch by default.)
os.environ['OAUTHLIB_RELAX_TOKEN_SCOPE'] = '1'
# Define the method to fetch attachments for a message
def fetch_attachment():
global error_count
global success_count
API_ROOT = 'https://graph.microsoft.com/'
API_VERSION = 'v1.0'
endpoint = API_ROOT + API_VERSION + RESOURCE
response = msgraph_session.get(endpoint).json()
if 'error' in response:
error_count += 1
LOG.info("Response from the attachments API is %r", response)
else:
success_count += 1
# Declare the statement that you want to time
STMT = '''
from __main__ import fetch_attachment
fetch_attachment()
'''
# Run the method and time it
if __name__ == '__main__':
time = timeit.timeit(STMT, number=20) # We will run the statement 20 times
LOG.info("Total time : %s", time)
LOG.info("Time per call: %s", float(time)/20)
LOG.info("Error Count %s", error_count)
LOG.info("Success Count %s", success_count)
OUTPUT
2018-08-02 11:36:53,510 - INFO - __main__ - Total time : 407.309007168
2018-08-02 11:36:53,510 - INFO - __main__ - Time per call: 20.3654503584
2018-08-02 11:36:53,511 - INFO - __main__ - Error Count 4
2018-08-02 11:36:53,511 - INFO - __main__ - Success Count 16
Out of 20 times, 4 returned the below error message
{
"error":{
"innerError":{
"date":"2018-08-02T18:32:27",
"request-id":"a52a676c-20a6-46c8-a71f-24ce35b166d7"
},
"message":"",
"code":"UnknownError"
}
}
abhi.
According to your information, I suppose you want to call the API /me/messages/{id}/attachments. Based on my test, when I add one attachment into the mail, calling this api is not slow.
But when add ten attachments, it's so slow. Because it will response each of the attachments content, so if each of the file is too large, it will be slow.
We can find the part of response like this:
{
"#odata.type": "#microsoft.graph.fileAttachment",
"id": "{attachmentID}",
"lastModifiedDateTime": "2018-08-14T07:18:21Z",
"name": "{attachment name}",
"contentType": "{attachment type}",
"contentBytes": ""
}
I think we can use the query parameters to customize responses. We can add the query parameter so that its response does not contain the file content. We can get each attachment id by the API like this:
https://graph.microsoft.com/beta/me/messages/{message id}/attachments?$select=id,name,size
Then we can get the content of attachment by the attachment id.
https://graph.microsoft.com/beta/me/messages/{message id}/attachments/{attachment id}

Http POST request taking lot of time to complete - net/http - Go

I am using net/http in Go, and one of my HTTPS POST request is taking lot of time like approx 16 seconds to complete . Though the backend server processing is only taking 2.2 seconds but over all process (when the response is received from the REST API after full processing ) is like 16 seconds .
My call looks like :
https://xxxxx.com/abcded
And the body has a JSON which contains a GIF file base64 of size approx 1.68 MB
{
"username": "test",
"update_username": "0",
"name": "test name",
"isprivate": "0",
"avatar_url": "",
"description": "I am Test , updated using api ",
"location": "test world",
"phone": "12345678",
"age": "23",
"gender": "m",
"update_profilepic": "1",
"profilepic_lat": "28.593",
"profilepic_lon": "77.1981",
"profilepic_height": "480",
"profilepic_width": "480",
"profilepic_type": "photo",
"profilepic": "Dummy String due to Size Constraint in StackOverFlow"
}
Details :
The POST request was invoked from the client (Postman) at 16:59:00.100 But the server recieves the call at 16:59:13.240 (which is shown in the Server logs below) . And finally the server does all the processing and responds back at 16:59:15.073 . And finally I recieved the response code at the client (Postman) at 16:59:15.773
Server Logs Start *****************************************
16:59:13.240
Just Entered into AUTHENTICATION method
16:59:13.246
--------------In Profile Related--------------
16:59:13.246
--------------In Edit Setting--------------
16:59:13.363
---------- In Edit Setting --------
16:59:13.363
Username direct rcvd :%!(EXTRA string=morninglad)
16:59:13.363
Username rcvd :%!(EXTRA string=morninglad)
16:59:13.363
Name rcvd :%!(EXTRA string=morning)
16:59:13.363
Update NON USER NAME UPDATE FLAG RCVD
16:59:13.363
About to call Update Query
16:59:13.374
About to Update the Profile Pic as found the flag
16:59:13.374
Updating the Profile Pic------------
16:59:14.906
About to Insert Media into DB
16:59:14.906
Got the GeoHash :%!(EXTRA string=ttnc9j3tgujw)
16:59:14.952
Found location :%!(EXTRA string=Gurugram)
16:59:14.955
Media Play value is :%!(EXTRA string=)
16:59:14.955
Username :%!(EXTRA string=morninglad)
16:59:14.983
Updating the Profile Pic Done ------------
16:59:14.983
Profile Pic Updated !
16:59:15.041
-------------------Fetch Avatars-----------------
16:59:15.073
The Avatar URL got :Avatar1
16:59:15.073
The Avatar URL got : Avatar2
16:59:15.073
---------- In Edit Setting DONE - END --------
16:59:15.073
--------------Response SENT--------------
Server Logs End *****************************************
So if I go by the above mentioned timestamps ,then time to reach to server was almost 13 seconds , and the total processing time of server was about 2 seconds . And finally recieved the response code in within 1 second.So total time is like 16 seconds for this call.
So I was trying to figure out why the call to reach to server is taking 13 seconds ?
When I am invoking the same call with the smaller body i.e instead of GIF of 1.68 MB to JPEG of 1.4 KB the total time is like 2.2 seconds . So shall I assume that this body size is the reason for increased time ?
But with the kind of internet I am working on (Download speed - 72.33 Mbps and Upload Speed - 6.07 Mbps)this sounds weird .
Any pointer if I am doing something wrong over here ?

Analytics events not being logged to Firebase

I'm attempting to log simple analytic events to Firebase but nothing is ever showing up online.
Here is how I'm logging the event:
FIRAnalytics.logEventWithName("spot_view", parameters: [
"spot_name": spotName,
"is_private": isPrivate
])
I have the run time arguments on to see the Firebase output and I get this:
<FIRAnalytics/DEBUG> Event logged. Event name, event params: spot_view, {
"_o" = app;
"is_private" = 1;
"spot_name" = TestLogSpotView;
}
So the event is being triggered. I also get this showing that data is actually being uploaded:
2016-06-09 12:12:13.567 [60279:] <FIRAnalytics/DEBUG> Measurement data sent to network. Timestamp (ms), data: 1465488733550, <ACPMeasurementBatch 0x7de7bb60>: {
bundles {
protocol_version: 1
events {
params {
name: "_c"
int_value: 1
}
params {
name: "_o"
string_value: "auto"
}
name: "_f"
timestamp_millis: 1465488710347
}
events {
params {
name: "_et"
int_value: 1
}
params {
name: "_o"
string_value: "auto"
}
name: "_e"
timestamp_millis: 1465488710347
}
events {
params {
name: "_o"
string_value: "app"
}
params {
name: "is_private"
int_value: 1
}
params {
name: "spot_name"
string_value: "TestLogSpotView"
}
name: "spot_view"
timestamp_millis: 1465488710411
}
events {
params {
name: "content_type"
string_value: "cont"
}
params {
name: "_o"
string_value: "app"
}
params {
name: "item_id"
string_value: "1"
}
name: "select_content"
timestamp_millis: 1465488710411
}
user_attributes {
set_timestamp_millis: 1465488710347
name: "_fot"
int_value: 1465491600000
}
upload_timestamp_millis: 1465488733550
start_timestamp_millis: 1465488710347
end_timestamp_millis: 1465488710411
platform: "ios"
os_version: "9.3"
device_model: "x86_64"
user_default_language: "en-us"
time_zone_offset_minutes: -240
app_store: "manual_install"
app_id: “——“
app_version: "0.0.0"
gmp_version: 3200
uploading_gmp_version: 3200
resettable_device_id: “—“——
limited_ad_tracking: false
app_instance_id: “———“
bundle_sequential_index: 1
gmp_app_id: “———“
firebase_instance_id: “———“
app_version_major: 106
}
}
2016-06-09 12:12:13.568[60279:] <FIRAnalytics/DEBUG> Uploading data. Host: https://app-measurement.com/a
2016-06-09 12:12:13.595[60279:] <FIRAnalytics/DEBUG> Received SSL challenge for host. Host: https://app-measurement.com/a
2016-06-09 12:12:13.731[60279:] <FIRAnalytics/DEBUG> Successful upload. Got network response. Code, size: 204, 0
I ran this same code a couple of days ago and still nothing has showed up in Firebase.
I've also tried logging an event copied straight from Firebase which is this:
FIRAnalytics.logEventWithName(kFIREventSelectContent, parameters: [
kFIRParameterContentType:"cont",
kFIRParameterItemID:"1"
])
Which you can see in the log console output posted above.
The only other thing I could think would be wrong is in the GoogleService-Info.plist. There is an entry for IS_ANALYTICS_ENABLED which is set to no. I just flipped it to YES and going to try again although I don't believe this to be the fix. I think this entry only applies to Google Analytics.
Which also, other data such as device type and user sessions IS being logged. So it just logging events that doesn't work.
This may be one reason for custom events
Event name must contain only letters, numbers, or underscores.
My events were not logged as I was using a space in my event name.
One quick thing to check -- make sure your date range encompasses the date on which this event was logged. For example, if the event was logged today, you should change the date range to explicitly include Today. Ranges like "Last 30 Days" or "Last 7 Days" do not include Today.
If you don't see your reports update, you should contact support in order to get to the bottom of it more quickly.
Just for those unfortunate subjects (like myself) that get to this question while not seeing ANY Firebase analytics output anymore (no events in the Firebase console online and no local Firebase debug messages). For whatever reason, by accident, I removed the code that used to call
FIRApp.configure()
No matter what other flags or such I set, Analytics events that always worked fine before wouldn't show up. And the logging code still worked without any complaints -- just not doing anything apparently. The configure() call was the last thing that I came to check.
This might be a late answer but I double checked other solution and still had similar issue.
I fixed the issue by looking at the parameters sent with the event. Make sure all parameters are sent have a value.

Nagios set higher interval for notifications

I want to set the interval of each notification sent by my nagios server to send a 6 hour interval. But with my current set up it seems that the commands interval is set to 1 hour. Here is my default template for my servers monitoring and how I use it.
define host{
name linux-vps
use generic-host
check_period 24x7
check_interval 5
retry_interval 1
max_check_attempts 10
check_command check-host-alive
notification_period 24x7
notification_interval 360
notification_options d,r
contact_groups admins
register 0
}
define host{
use linux-vps
host_name linux-server
alias CentOS 6
address xxx.xxx.xxx.xxx
}
On the Nagios server the config says the host notification interval is set to 6 hours.
Are the alerts coming through service or host alerts? It could be that your service notification_interval is set to 1 hour.

How to send email with Tests statistics like Total Tests: 10, Failed: 2, Passed: 8, Skipped:0

I am using Maven+TestNG auto-tests run by Jenkins. How do i display the test statistics in the email notification Jenkins sends.
I would like something like this:
Results:
Total Tests: 10, Passed: 8, Failed: 2, Skipped:0
Resolved the issue by using using Email Extension Plugin and one of the email template. See attachment.

Resources