-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
SHOW DIAGNOSTICS command #2061
SHOW DIAGNOSTICS command #2061
Conversation
@@ -93,6 +99,10 @@ type Server struct { | |||
// is just getting the request after being off duty for running CQs then | |||
// it will recompute all of them | |||
lastContinuousQueryRun time.Time | |||
|
|||
// Build information. |
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.
I think it's important the server object get this stuff, so it be dumped by the diags. I am open to other approaches.
2fc52c6
to
2b127e9
Compare
func (s *Server) executeShowDiagnosticsStatement(stmt *influxql.ShowDiagnosticsStatement, user *User) *Result { | ||
rows := make([]*influxql.Row, 0) | ||
|
||
// Build information. |
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.
Making this more table-driven, stand by.
2b127e9
to
372386c
Compare
Table-driven code put in place. Green build. |
f9da484
to
e5907e6
Compare
e5907e6
to
f6644d4
Compare
|
bf83794
to
895b781
Compare
👍 Very exciting! |
"version": runtime.Version(), | ||
}, | ||
}, | ||
} |
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.
I think it'd be easier to use this data from a client or another system if it were a type:
type Diagnostics struct {
Build struct {
Version string `json:"version"`
CommitHash string `json:"commitHash"`
} `json:"build"`
Server struct {
ID string `json:"id"`
Path string `json:"path"`
AuthEnabled bool `json:"authenticationEnabled"`
...
}
}
And then you can get the current Diagnostics
type using NewDiagnostics()
. That would shorten this function quite a bit.
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.
Or maybe name it Stats
instead -- similar to MemStats
.
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.
I was thinking about something along those lines this morning, but it wasn't clear exactly what to do.
The Diagnostics
type needs information from various components -- the server, build information, Go runtime, indexes. Which part of the code fills in the values? I want to do something like this, as I want to factor out this code next so that it can be written to the database (like the stats) every minute or so.
Let me know what you have in mind, as I was going to something like this next.
No description provided.