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

incorrect check in history status #6785

Open
rishichawda opened this issue Mar 10, 2022 · 1 comment
Open

incorrect check in history status #6785

rishichawda opened this issue Mar 10, 2022 · 1 comment
Labels
bug 🐛 Something isn't working

Comments

@rishichawda
Copy link
Member

rishichawda commented Mar 10, 2022

Thanks @cmailank for reporting this.

Describe the bug

The client run status for the previous day seems to be missing if the run happened within 24 hours from now. As we can see it reports check in for only today while there was a client run yesterday and another one today. So we would expect 2 icons in the time series. Based on the UI, a user would expect that "Today" is 00:00Hrs to now.

MicrosoftTeams-image (1)

Even in the infrastructure dashboard it clearly shows the client runs are from different days.

MicrosoftTeams-image (2)

To Reproduce

Steps to reproduce the behavior:

  • Chef client run on X date.
  • Chef client run on the next day after X but within 24 hour period of the client run on X date.

Expected behavior

A user would expect the status data to be separated based on local time.

Versions (please complete the following information):

  • OS: [e.g. rhel6] any
  • Browser [e.g. chrome, safari] any
  • Automate Build Number: 20220223121207

Additional context

I took the liberty to look into it further and it seems like the request to node_runs_daily_status_time_series is returning something like this. Which tells us that the most recent status was 24hours back from now rather than 00:00Hrs to now for today.

Screenshot 2022-03-10 at 5 41 23 PM

Which is also confirmed by the function at

func (s *CfgMgmtServer) GetNodeRunsDailyStatusTimeSeries(ctx context.Context,
which uses the utility function
func calculateStartEndCheckInTimeSeries(daysAgo int32) (time.Time, time.Time) {
now := time.Now()
endTime := time.Date(now.Year(), now.Month(), now.Day(),
now.Hour(), 0, 0, 0, time.UTC).Add(time.Hour)
startTime := endTime.Add(-time.Hour * 24 * time.Duration(daysAgo))
return startTime, endTime
}
that is written in such a way that it calculates X*24 hours ago from when the request was made to the server with UTC time.

@rishichawda rishichawda added the bug 🐛 Something isn't working label Mar 10, 2022
@rishichawda
Copy link
Member Author

On a side note, the infrastructure tab shows the client run timings in UTC - it should be localised. As a user I would probably be interested in seeing times in my local time zone.

MicrosoftTeams-image (2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant