Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRILL-5921: Display counter metrics in table #1020

Closed
wants to merge 2 commits into from

Conversation

prasadns14
Copy link
Contributor

Listed the counter metrics in a table
@arina-ielchiieva please review

var update = function() {
$.get("/status/metrics", function(metrics) {
updateGauges(metrics.gauges);
updateBars(metrics.gauges);
if(! $.isEmptyObject(metrics.timers)) createTable(metrics.timers, "timers");
if(! $.isEmptyObject(metrics.histograms)) createTable(metrics.histograms, "histograms");
updateOthers(metrics);
if(! $.isEmptyObject(metrics.counters)) createCountersTable(metrics.counters);
if(! $.isEmptyObject(metrics.meters)) $("#metersVal").html(JSON.stringify(metrics.meters, null, 2));
Copy link
Member

Choose a reason for hiding this comment

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

@prasadns14

  1. Please add two screenshots before and after the changes.
  2. Can you please think of the way to make create table generic so can be used for timers, histograms and counters?
  3. What about meters? How they are displayed right now? Maybe we need to display them in table as well?
    Ideally, we can display all metrics in the same way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@arina-ielchiieva, please review

  1. Added three screenshots before (current behavior), snapshot1(reusing createTable function) and snapshot2 (new createCountersTable function)

  2. The function "createTable" lists the keys for each metric class, which looks good for "timers" and "histograms" as they have many keys. But the "counters" metric has only one key "count" (same as guages metric which has only key value). So, I have a added a new function to just list the class and count value.

  3. Currently we do not have any "meters" metric. So, I don't know how many keys "meters" metric will have. If we have multiple keys we can use createTable or else we may have to create a different function similar to createCountersTable. (depending on the key name)

I personally think if we have a single key, we shouldn't use the createTable function. We should just display the class and the only key value.

before

snapshot1

snapshot2

Copy link
Member

Choose a reason for hiding this comment

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

@prasadns14

  1. Thanks for adding the screenshots.
  2. Most of the code in createTable and createCountersTable coincide. I suggested you make one function. For example, with three parameters, createTable(metric, name, addReportingClass). When you don't need to add reporting class you'll call this method with false. Our goal here is generify existing methods rather then adding new specific with almost the same content.
  3. If we don't have any meters, let's remove them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@arina-ielchiieva,
I have considered reusing existing methods before deciding to have a separate method.
With the above suggestion, the table will now look as below-

drill.connections.rpc.control.encrypted | {count: 0}

'|' here is column delimiter. Do we want to display only the number in the second column or a key/value pair?
I just wanted it to be consistent with the other metrics tables. (so I print value.count)

Removed meters section.

Copy link
Member

Choose a reason for hiding this comment

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

Well, sounds good then, thanks for making the changes.

@arina-ielchiieva
Copy link
Member

+1, LGTM.

arina-ielchiieva pushed a commit to arina-ielchiieva/drill that referenced this pull request Nov 13, 2017
@asfgit asfgit closed this in ed6c4bc Nov 13, 2017
ilooner pushed a commit to ilooner/drill that referenced this pull request Jan 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants