Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

feat: add stats implementation #92

Merged
merged 2 commits into from
Aug 16, 2018
Merged

Conversation

eduardoemery
Copy link
Contributor

@eduardoemery eduardoemery commented Aug 7, 2018

No description provided.

Copy link
Contributor

@kjin kjin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments. Tests look good.

@@ -92,7 +92,7 @@ export class ConsoleStatsExporter implements types.StatsEventListener {
* @param view recorded view from measurement
* @param measurement recorded measurement
*/
onRecord(view: View, measurement: Measurement) {
console.log(`Measurement recorded: ${view.measure.name}`);
onRecord(views: View[], measurement: Measurement) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update JSDocs here and elsewhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, thanks for noticing.

this.registerView(view);
return view;
} catch (err) {
throw (err);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this try-catch block?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm not really. This was used in another approach I was trying and it ended up staying. Thanks for noticing, removed.

}

/**
* Registers an exporter to send stats data to a service.
* @param exporter An stats exporter
*/
registerExporter(exporter: StatsEventListener) {
throw new Error('Not Implemented');
this.statsEventListeners.push(exporter);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we immediately notify it of all currently registered views?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely! I hadn't considered this case but it is really important! Thanks for the suggestion.

@kjin kjin merged commit c7226d6 into census-instrumentation:master Aug 16, 2018
kjin pushed a commit to kjin/opencensus-node that referenced this pull request Aug 24, 2018
* feat: add stats implementation

* refactor(fix): changes to address review comments
kjin pushed a commit to kjin/opencensus-node that referenced this pull request Aug 24, 2018
* feat: add stats implementation

* refactor(fix): changes to address review comments
kjin pushed a commit to kjin/opencensus-node that referenced this pull request Aug 24, 2018
* feat: add stats implementation

* refactor(fix): changes to address review comments
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants