Skip to content

Instantly share code, notes, and snippets.

@ChrisLundquist
Last active October 21, 2015 20:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChrisLundquist/31b1a9355707f83d4842 to your computer and use it in GitHub Desktop.
Save ChrisLundquist/31b1a9355707f83d4842 to your computer and use it in GitHub Desktop.
Crash Tests
  • Download / copy paste send_report and ab.data
  • Install ab ( apache bench, on OS X you might already have it )
  • Open a Terminal window where send_report and ab.data are.
  • Ensure send_report is runable with chmod +x send_report
  • Make sure ab.data is in the same folder as send_report
  • Run it ./send_report <count> <project id>

After 5 seconds you should see your test data on the website.

{
"user_id": "",
"message": "Exception: Button press exception",
"stack_trace": "ThrowMeAnException.CrashForMe () (at Assets/Plugins/UnityPerf/ThrowMeAnException.cs:17)\nUnityEngine.Events.InvokableCall.Invoke (System.Object[] args)\nUnityEngine.Events.InvokableCallList.Invoke (System.Object[] parameters)\nUnityEngine.Events.UnityEventBase.Invoke (System.Object[] parameters)\nUnityEngine.Events.UnityEvent.Invoke ()\nUnityEngine.UI.Button.Press () (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Button.cs:35)\nUnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Button.cs:44)\nUnityEngine.EventSystems.ExecuteEvents.Execute (IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:52)\nUnityEngine.EventSystems.ExecuteEvents.Execute[IPointerClickHandler] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.EventFunction`1 functor) (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:269)\nUnityEngine.EventSystems.EventSystem:Update()\n",
"log_level": "Exception",
"operating_system": "Mac OS X 10.9.4",
"device_model": "MacBookPro10,1",
"device_type": "Desktop",
"graphics_device": "4053",
"version": "1.0.0",
"counter": "1"
}
$ script/send_report 100 '84cf519b-e6a2-44f1-9745-5feb89d2a78f'
Sending 100 crash events...
This is ApacheBench, Version 2.3 <$Revision: 1663405 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking perf-events.cloud.unity3d.com (be patient).....done
Server Software:
Server Hostname: perf-events.cloud.unity3d.com
Server Port: 443
SSL/TLS Protocol: TLSv1,DHE-RSA-AES128-SHA,2048,128
Document Path: /api/projects/84cf519b-e6a2-44f1-9745-5feb89d2a78f/crash_log
Document Length: 0 bytes
Concurrency Level: 10
Time taken for tests: 0.464 seconds
Complete requests: 100
Failed requests: 0
Keep-Alive requests: 100
Total transferred: 16800 bytes
Total body sent: 182000
HTML transferred: 0 bytes
Requests per second: 215.74 [#/sec] (mean)
Time per request: 46.352 [ms] (mean)
Time per request: 4.635 [ms] (mean, across all concurrent requests)
Transfer rate: 35.40 [Kbytes/sec] received
383.45 kb/s sent
418.84 kb/s total
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 15 46.2 0 181
Processing: 26 30 7.5 28 70
Waiting: 26 30 7.5 28 70
Total: 26 45 47.0 28 210
Percentage of the requests served within a certain time (ms)
50% 28
66% 29
75% 32
80% 34
90% 165
95% 189
98% 196
99% 210
100% 210 (longest request)
#!/bin/sh
if [ $# -ne 2 ]; then
echo "You need 2 parameters: COUNT PROJECT_ID"
echo
echo "For example:"
echo "$0 100 '84cf519b-e6a2-44f1-9745-5feb89d2a78f'"
exit 2
fi
COUNTER=$1
PROJECT_ID=$2
echo "Sending ${COUNTER} crash events..."
ab -T 'application/json' -k -p script/ab.data -n ${COUNTER} -c 10 https://perf-events.cloud.unity3d.com/api/projects/${PROJECT_ID}/crash_log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment