Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

remove random

  • Loading branch information...
commit 7c62bbd905e4153f366db8646f3abd554e1f383a 1 parent 88a01df
@hochang hochang authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 modules/engine/lib/engine/log-emitter.js
View
8 modules/engine/lib/engine/log-emitter.js
@@ -26,9 +26,15 @@ var eventTypes = require('./event-types.js'),
* The point of this emitter is to capture events in a hierarchy so know which part of the script
* caused what HTTP request.
*/
+
+var tid = 0;
var LogEmitter = module.exports = function() {
events.EventEmitter.call(this);
+ function gettid(){
+ return tid++;
+ }
+
/**
* This begins a new event and returns an event object
*
@@ -61,7 +67,7 @@ var LogEmitter = module.exports = function() {
type: type || 'ql.io',
name: name || 'ql.io',
uuid: (parent && parent.uuid ? parent.uuid : uuid()),
- tid: (parent && parent.tid ? parent.tid : Math.random()) // nodejs does not has multiple threads. the tid would trick Cal to consider calls in different threads.
+ tid: (parent && parent.tid ? parent.tid : gettid()) // nodejs does not has multiple threads. the tid would trick Cal to consider calls in different threads.
};
this.emit(eventTypes.BEGIN_EVENT, event, message);

0 comments on commit 7c62bbd

Please sign in to comment.
Something went wrong with that request. Please try again.