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

Issue 20852: Flooring number down to whole second #38065

Merged
merged 1 commit into from Jun 12, 2019

Conversation

igoristic
Copy link
Contributor

@igoristic igoristic commented Jun 5, 2019

Summary

Resolves #20852

formatMetric was rounding float seconds to whole numbers, so something like: 59500ms (59.5 seconds) would equal to 60 seconds

To see Shard Activity go to: Stack Monitoring > Elasticsearch Overview > then scroll all the way down

Please note you might not see any Shard Activity initially, so increase From Now time span at the top right. If you still don't see any activity try ingesting a decent amount of new data into ES

@igoristic igoristic added bug Fixes for quality problems that affect the customer experience Team:Monitoring Stack Monitoring team v8.0.0 v7.2.0 labels Jun 5, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/stack-monitoring

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@chrisronline
Copy link
Contributor

@igoristic Would you including testing steps, including which UIs/views we should expect to see the change?

@chrisronline
Copy link
Contributor

I'm not sure this is the right fix.

Here is the UI for me, prefix:
Screen Shot 2019-06-10 at 9 10 29 AM

Here is what I see with your PR:
Screen Shot 2019-06-10 at 9 12 18 AM

@igoristic
Copy link
Contributor Author

@chrisronline I couldn't reproduce this. I don't think my change is significant enough to cause such a drastic behavior, since all it does is rounds down eg: floor(ms / 1000). Is it possible that the ms times changed to less than 1000 when testing with my branch? in which case it would indeed be 0s

Also, can you post your shardActivity from x-pack/plugins/monitoring/public/components/elasticsearch/overview/overview.js by doing something like:
JSON.stringify(shardActivity)

@chrisronline
Copy link
Contributor

[{
  "translog": {
    "total_on_start": 0,
    "recovered": 0,
    "total": 0,
    "total_time_in_millis": 30,
    "percent": "100.0%"
  },
  "verify_index": {
    "total_time_in_millis": 0,
    "check_index_time_in_millis": 0
  },
  "stop_time_in_millis": 1560350805932,
  "index": {
    "size": {
      "total_in_bytes": 0,
      "reused_in_bytes": 0,
      "percent": "0.0%",
      "recovered_in_bytes": 0
    },
    "total_time_in_millis": 65,
    "files": {
      "total": 0,
      "recovered": 0,
      "percent": "0.0%",
      "reused": 0
    },
    "target_throttle_time_in_millis": 0,
    "source_throttle_time_in_millis": 0
  },
  "source": {},
  "type": "EMPTY_STORE",
  "target": {
    "transport_address": "127.0.0.1:9301",
    "ip": "127.0.0.1",
    "host": "127.0.0.1",
    "name": "Elastic-MBP",
    "id": "ZYoB7yGiSYivEVu_mqLl0Q"
  },
  "stage": "DONE",
  "total_time_in_millis": 109,
  "start_time_in_millis": 1560350805823,
  "id": 0,
  "index_name": ".monitoring-es-7-2019.06.12",
  "primary": true
}, {
  "translog": {
    "total_on_start": 0,
    "recovered": 0,
    "total": 0,
    "total_time_in_millis": 30,
    "percent": "100.0%"
  },
  "verify_index": {
    "total_time_in_millis": 0,
    "check_index_time_in_millis": 0
  },
  "stop_time_in_millis": 1560350803518,
  "index": {
    "size": {
      "total_in_bytes": 0,
      "reused_in_bytes": 0,
      "percent": "0.0%",
      "recovered_in_bytes": 0
    },
    "total_time_in_millis": 73,
    "files": {
      "total": 0,
      "recovered": 0,
      "percent": "0.0%",
      "reused": 0
    },
    "target_throttle_time_in_millis": 0,
    "source_throttle_time_in_millis": 0
  },
  "source": {},
  "type": "EMPTY_STORE",
  "target": {
    "transport_address": "127.0.0.1:9301",
    "ip": "127.0.0.1",
    "host": "127.0.0.1",
    "name": "Elastic-MBP",
    "id": "ZYoB7yGiSYivEVu_mqLl0Q"
  },
  "stage": "DONE",
  "total_time_in_millis": 120,
  "start_time_in_millis": 1560350803398,
  "id": 0,
  "index_name": ".monitoring-kibana-7-2019.06.12",
  "primary": true
}]

The issue is if the total_time_in_millis is less than 1s, these changes will always show 0:00:00 which isn't entirely accurate, as there are some milliseconds we can show there.

Copy link
Contributor

@chrisronline chrisronline left a comment

Choose a reason for hiding this comment

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

Disregard my last statements. I was confusing myself with the current functionality.

This LGTM!!

@igoristic
Copy link
Contributor Author

Backport:
7.x: 6bf25b5
7.2: 0c80579
6.8: 4b5ebdd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Team:Monitoring Stack Monitoring team v6.8.1 v7.2.1 v7.3.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Monitoring] Shard Activity shows "60" seconds instead of 1 minute
3 participants