While we don't have a widget within the Active Dashboard Palette to display date and time on a dashboard, it is possible to add date and time to a dashboard with some additional steps. With the Compute Engine feature you can add a blank headline cell with a label to an existing dataview, and add a rule to the headline cell to display date and time. You can then drag and drop the newly added headline cell to your Dashboard. Below are the steps:
Add a headline cell to an existing dataview using Compute Engine:
- Select the sampler you want to add the headline cell to, and select the Advanced tab at the top of the sampler record.
- Once there, select "Add new" under the "Dataviews."
- On the "Name" field add the dataview name you wish to add the headline cell to
- Click "Additions" on the right-hand side to open the Additions window to add the headline cell name as seen below:
- Close the Additions window once done, and save the changes in the Gateway Setup Editor.
You should now see the a blank headline cell titled "Timestamp" in the CPU dataview.
Add rule to newly added headline cell:
The following rule uses the now() function to get the current time at the point of the rule execution. The time is expressed as seconds since UNIX epoch. The printDate() function is used to convert the timestamp grabbed from the now() function and format it based off the formatting codes set. For a full list of available format codes check out the Time Formatting Printing Codes section of the Time Formats document.
This rule uses the %Z specifier to display the time zone abbreviation. As such, the rule will display the date and time based on the Gateway's time zone.
Notice the Timestamp headline cell is no longer blank and displays the date and time along with the time zone abbreviation.
If you would like to set a time zone for which to format the date and time from, the printDate() function has a third optional parameter that allows you to specify the time zone region. The below rule will display the time in Central Standard Time (CST).
For a full list of time zone abbreviations and their accompanying time zone region name run the following command in the gateway's local directory:
Create Dashboard Object:
Once the headline cell is ready, it can be dragged and dropped to the Active Dashboard. Notice the "Tools & Modifiers" window comes up. In this example, we selected the "Block 4 with Value" object which has a built in modifier that will display the value from the Timestamp headline cell.
If you have follow up questions about this FAQ:
- Please contact our Client Services team via the chat service box available in any of our websites or email us at email@example.com
- Make sure you provide to us:
- Sampler and rule XML used for your example.
- Screenshots of the "Show Rules" output of the rule you set up
- Description of which part of the rule you are having issues setting up, or not working
Please sign in to leave a comment.