Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Orion/Metrics"

m (update Category/Action)
(logTiming(timingCategory, timingVar, timingValue, timingLabel))
Line 27: Line 27:
  
 
== logTiming(timingCategory, timingVar, timingValue, timingLabel) ==
 
== logTiming(timingCategory, timingVar, timingValue, timingLabel) ==
This is similar to log event, but is for recording timings. Timings to be logged should be explicitly measured (ie.- use newDate().getTime() to record the start and end times of a scenario and then subtract them to determine the interval).  timingValue should be in milliseconds.
+
This is similar to log event but is for recording timings. The function takes four parameters as follows:
  
Note that if you're timing something during page loading then the new HTML5 "performance" variable may be helpful (currently implemented in Chrome and IE). All current page load timings make use of this.
+
;timingCategory
 +
: (required) The String name of the category to log the timing to
 +
; timingVar
 +
: (required) The String name of the variable to log the timing to
 +
; timingValue
 +
: (required) The Number in milliseconds of the timing. Timings to be logged should be explicitly measured using <code>Date.now()</code> or <code>performance.now()</code> to record the start and end times. To get the overall timing, subtract the start from the end to determine the interval.
 +
; timingLabel
 +
: (required) The String label for the timing
  
The base set of category/var groups that currently exists:
+
Note that if you're timing something during page loading then the new [https://developer.mozilla.org/en-US/docs/Web/API/Window/performance HTML5 performance variable] may be helpful.  All current page load timings make use of this.
  
'''Category/Var'''
+
The base set of categories and variables in use are outlined below:
<ul>
+
{| class="wikitable" width="35%"
<li>page/complete</li>
+
! style="text-align:left" | Category
<li>page/interactive</li>
+
! style="text-align:left" | Variable
</ul>
+
! style="text-align:center" | Since
 +
|-
 +
| style="text-align:left" | language tools
 +
| style="text-align:left" | parse
 +
| style="text-align:center" | 9.0
 +
|-
 +
| style="text-align:left" | page
 +
| style="text-align:left" | complete
 +
| style="text-align:center" | 8.0
 +
|-
 +
| style="text-align:left" | page
 +
| style="text-align:left" | interactive
 +
| style="text-align:center" | 8.0
 +
|}

Revision as of 12:37, 18 March 2015

orion/metrics is the place for logging runtime events and timings to be consumed by an analytics engine. The API follows:

logEvent(category, action, label, value)

The parameters are essentially categorizations of the event progressing from least- to most-specific. The first three parameters are strings, and the fourth (optional) parameter is a number.

A base set of category/action groups has been established (listed below). New kinds of events to be logged should try to fit into an existing group when possible in order to keep the set of namespaces under control. If there really isn't a good place for your new event in the current set of groups then a new category and/or action can be defined (and please update the list below).

Most category/action groups should be self-explanatory, possibly with the exception of the "ui" category. This category is for tracking UI-level events or details that are not already captured by other events. For instance, tracking that a particular button was pressed (if a command is invokable from different places), tracking when a particular UI element is touched or hovered over, etc.

Category/Action:

  • command/invoke
  • contentAssist/activate
  • contentAssist/apply
  • editor/action
  • editor/open
  • help/open
  • preferenceChange
  • runtime/uncaughtError
  • shell/invoke
  • status/error
  • status/exception
  • status/success
  • status/warning
  • ui/invoke

logTiming(timingCategory, timingVar, timingValue, timingLabel)

This is similar to log event but is for recording timings. The function takes four parameters as follows:

timingCategory
(required) The String name of the category to log the timing to
timingVar
(required) The String name of the variable to log the timing to
timingValue
(required) The Number in milliseconds of the timing. Timings to be logged should be explicitly measured using Date.now() or performance.now() to record the start and end times. To get the overall timing, subtract the start from the end to determine the interval.
timingLabel
(required) The String label for the timing

Note that if you're timing something during page loading then the new HTML5 performance variable may be helpful. All current page load timings make use of this.

The base set of categories and variables in use are outlined below:

Category Variable Since
language tools parse 9.0
page complete 8.0
page interactive 8.0

Back to the top