Closed
Bug 724368
Opened 14 years ago
Closed 12 years ago
telemetry for number of threads
Categories
(Core :: General, defect)
Tracking
()
RESOLVED
FIXED
mozilla23
People
(Reporter: dietrich, Assigned: Yoric)
References
Details
Attachments
(3 files, 4 obsolete files)
|
3.57 KB,
patch
|
Yoric
:
review+
|
Details | Diff | Splinter Review |
|
5.13 KB,
patch
|
froydnj
:
review+
|
Details | Diff | Splinter Review |
|
3.68 KB,
patch
|
Yoric
:
review+
|
Details | Diff | Splinter Review |
in bug 679498, tantek has ~1000 threads. we should add telemetry for thread count, to see how common a problem this is.
| Assignee | ||
Updated•13 years ago
|
Whiteboard: [mentor=Yoric][lang=c++]
Comment 1•13 years ago
|
||
Do we want the peak count for the entire session, or do we want to sample periodically and make a histogram of peak thread counts over some time interval (that is, every n minutes we insert a histogram entry for the peak number of threads seen during the preceding n minutes)?
| Assignee | ||
Comment 2•13 years ago
|
||
For the moment, we are interested in a peak count. If this peak count is worrying, it there will still be time for something more detailed.
I have a C++ patch that extracts the information, and I am now looking for the most appropriate place to feed this to Telemetry. Nathan suggested using your hooks from bug 852974.
| Assignee | ||
Comment 3•13 years ago
|
||
Doug, do you have the time to review this patch?
Assignee: nobody → dteller
Attachment #731114 -
Flags: review?(doug.turner)
| Assignee | ||
Comment 4•13 years ago
|
||
Attachment #731115 -
Flags: review?(nfroyd)
| Assignee | ||
Comment 5•13 years ago
|
||
This passes tests. However, I have not found if adding a simple measurement requires some registration.
Attachment #731116 -
Flags: feedback?(nfroyd)
Comment 6•13 years ago
|
||
Comment on attachment 731115 [details] [diff] [review]
2. Exposing the maximal number of threads to Telemetry
Review of attachment 731115 [details] [diff] [review]:
-----------------------------------------------------------------
r=me with the IDL change and similar change to the .cpp.
::: toolkit/components/telemetry/nsITelemetry.idl
@@ +88,5 @@
> + /**
> + * A number representing the highest number of concurrent threads
> + * reached during this session.
> + */
> + readonly attribute jsval maximalNumberOfConcurrentThreads;
Why not just make this an int (or long, if that's what it needs to be)?
Attachment #731115 -
Flags: review?(nfroyd) → review+
| Assignee | ||
Comment 7•13 years ago
|
||
Fixed, thanks.
Attachment #731115 -
Attachment is obsolete: true
Attachment #731153 -
Flags: review+
Comment 8•13 years ago
|
||
Comment on attachment 731116 [details] [diff] [review]
3. Uploading the result
Review of attachment 731116 [details] [diff] [review]:
-----------------------------------------------------------------
::: toolkit/components/telemetry/tests/unit/test_TelemetryPing.js
@@ +34,5 @@
> const PR_CREATE_FILE = 0x8;
> const PR_TRUNCATE = 0x20;
> const RW_OWNER = 0600;
>
> +const NUMBER_OF_THREADS_TO_LAUNCH = 100;
I think you could get by with fewer threads.
@@ +48,5 @@
>
> +// Launch a number of threads, just for the sake of measuring the total number
> +// of threads concurrently executing.
> +for (let i = 0; i < NUMBER_OF_THREADS_TO_LAUNCH; ++i) {
> + Services.tm.newThread(0);
For sanity's sake, I think you want to measure the number of threads that actually got launched and use that below to avoid test failures induced by low memory or other conditions. Catching failure of the newThread call would be part of that. Please also move this into the main test function; I don't think there's a good reason for this to be at top level.
Bonus points if you add code to clean up these launched threads as well.
Attachment #731116 -
Flags: feedback?(nfroyd) → feedback+
| Assignee | ||
Comment 9•13 years ago
|
||
Attachment #731116 -
Attachment is obsolete: true
Attachment #731158 -
Flags: review?(nfroyd)
Comment 10•13 years ago
|
||
Comment on attachment 731158 [details] [diff] [review]
3. Uploading the result, v2
Review of attachment 731158 [details] [diff] [review]:
-----------------------------------------------------------------
r=me.
Attachment #731158 -
Flags: review?(nfroyd) → review+
Comment 11•13 years ago
|
||
Comment on attachment 731114 [details] [diff] [review]
1. Exposing the maximal number of threads to C++.
Review of attachment 731114 [details] [diff] [review]:
-----------------------------------------------------------------
::: xpcom/threads/nsThreadManager.h
@@ +43,5 @@
> nsThread *GetCurrentThread();
>
> + // Returns the maximal number of threads that have been in existence
> + // simultaneously during the execution of the thread manager.
> + uint GetHighestNumberOfThreads();
Is there any reason for uint here? I think other code uses uint32_t in xpcom.
Attachment #731114 -
Flags: review?(doug.turner) → review+
| Assignee | ||
Comment 12•13 years ago
|
||
Switching everything to uint32_t for consistency.
Attachment #731114 -
Attachment is obsolete: true
Attachment #732741 -
Flags: review+
| Assignee | ||
Comment 13•13 years ago
|
||
| Assignee | ||
Updated•13 years ago
|
Whiteboard: [mentor=Yoric][lang=c++]
| Assignee | ||
Comment 14•12 years ago
|
||
Same one, with a typo fix.
Try: https://tbpl.mozilla.org/?tree=Try&rev=bd1e7da1f2ae
Attachment #732741 -
Attachment is obsolete: true
Attachment #739221 -
Flags: review+
| Assignee | ||
Updated•12 years ago
|
Keywords: checkin-needed
Comment 15•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/4fb6cb545326
https://hg.mozilla.org/integration/mozilla-inbound/rev/532c3e448de0
https://hg.mozilla.org/integration/mozilla-inbound/rev/c549149d2b9e
Flags: in-testsuite+
Keywords: checkin-needed
Comment 16•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/4fb6cb545326
https://hg.mozilla.org/mozilla-central/rev/532c3e448de0
https://hg.mozilla.org/mozilla-central/rev/c549149d2b9e
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
You need to log in
before you can comment on or make changes to this bug.
Description
•