-
Notifications
You must be signed in to change notification settings - Fork 24
feat(dashboard): set Feed Expiration visualization to Bar Gauge #113
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
Open
anant-shipit
wants to merge
2
commits into
OneBusAway:main
Choose a base branch
from
anant-shipit:feat/issue-98-feed-expiration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: OneBusAway/watchdog
Length of output: 246
🏁 Script executed:
Repository: OneBusAway/watchdog
Length of output: 1408
🌐 Web query:
Grafana dtdurations value format decimals behavior display next duration component💡 Result:
In Grafana, the dtdurations unit (Duration (s)) is a specialized formatter designed to represent numeric values (interpreted as seconds) as human-readable durations [1][2][3]. The behavior of decimals and the display of duration components is governed by Grafana's internal display processor, which dynamically handles unit scaling based on the magnitude of the value [4][5][6]. Key behaviors include: 1. Automatic Scaling and Precision: By default, Grafana automatically determines the scale (e.g., seconds, milliseconds) and truncates decimals based on the magnitude of the data [6]. When the Decimals option is left empty, Grafana attempts to automatically truncate excess precision [6]. If a specific decimal count is provided, it dictates the precision used in the formatted output [4]. 2. Decimals Behavior: Setting the Decimals option to a fixed number (e.g., 0) can influence how Grafana renders values [7][5]. Users have reported that forcing 0 decimals can sometimes cause issues with Y-axis granularity or result in NaN values when data ranges are very tight, as the formatter may struggle to represent small variations within a single unit interval (e.g., sub-second differences) [7][5]. 3. Display of Duration Components: The dtdurations unit generally scales automatically to the most appropriate unit [6]. If you require a specific format that explicitly displays multiple components (like days, hours, minutes, and seconds), you may need to use other dedicated units, such as: - dthms (Duration (hh:mm:ss)) [1][2] - dtdhms (Duration (d hh:mm:ss)) [1][2] Because dtdurations is a dynamic formatter, it does not always offer granular control over exactly which "next" duration component is displayed if the value is very small; it will shift the display to milliseconds or other smaller units as necessary to maintain accuracy [4][5]. If you encounter rendering issues (such as NaN or loss of data), it is often related to how the automatic scaling interacts with fixed decimal constraints on the axis [7][5].
Citations:
🌐 Web query:
Grafana dtdurations formatter days weeks decimals components source Grafana v13.0.2💡 Result:
In Grafana v13.0.2, the dtdurations formatter (labeled as "duration (s)" in the UI) is designed to automatically scale duration values based on their magnitude [1][2]. It is not currently possible to manually force this formatter to use specific components like days or weeks while excluding others, nor is there a setting to explicitly lock the units to a specific scale while allowing decimal values [3]. Technical details for the dtdurations formatter: 1. Functionality: The formatter is defined by the toDurationInSeconds function within Grafana's codebase [1]. It applies automatic unit scaling based on the magnitude of the input value [2]. 2. Scaling Logic: The formatter automatically transitions between units based on thresholds [2]: - Less than 1 µs: Uses ns - Less than 1 ms: Uses µs - Less than 1 s: Uses ms - Less than 60 s: Uses s - Less than 3600 s: Uses minutes (min) - Less than 86400 s: Uses hours (hour) - Less than 604800 s: Uses days (day) - Less than 31536000 s: Uses weeks (week) - Above this threshold: Uses years [2]. 3. Decimals: The formatter accepts a DecimalCount parameter which controls the precision of the output [2]. When the value reaches the threshold for a specific unit (e.g., days), the value is divided by the relevant constant (e.g., 86400 for days) and displayed with the specified number of decimals [2]. Because this behavior is hardcoded in the data transformation logic, users seeking to force specific units (such as only days) are generally advised to either perform the unit conversion directly in their data source query or use a custom expression to divide the input value by the desired unit interval (e.g., dividing seconds by 86400) and applying a custom unit label [3].
Citations:
Set
dtdurationsto show the day-level countdown.Panel 201 uses
"unit": "dtdurations"without"decimals", so Grafana renders the largest duration component only. Add"decimals": 1so values such as several weeks and a day show the day component instead of only weeks.🤖 Prompt for AI Agents
Source: MCP tools