-
Notifications
You must be signed in to change notification settings - Fork 21
PMM-9632 Settings view usage. #374
base: main
Are you sure you want to change the base?
Conversation
@@ -92,7 +81,7 @@ const ( | |||
commandTypeUpdate = "UPDATE" | |||
commandTypeInsert = "INSERT" | |||
commandTypeDelete = "DELETE" | |||
commandTypeUtiity = "UTILITY" | |||
commandTypeUtility = "UTILITY" |
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.
Already fixed in previous PR, but its not merged yet.
Name string `reform:"name"` | ||
Value string `reform:"value"` | ||
DefaultValue string `reform:"default_value"` | ||
Description string `reform:"description"` | ||
Minimum *int64 `reform:"minimum"` | ||
Maximum *int64 `reform:"maximum"` | ||
Options *string `reform:"options"` | ||
Restart string `reform:"restart"` |
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.
let's keep only fields that we use in case PGSM team changes structure later we will have more PMM clients supported latest PGSM
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.
Done.
@@ -307,12 +242,12 @@ func (m *PGStatMonitorQAN) Run(ctx context.Context) { | |||
m.changes <- agents.Change{Status: inventorypb.AgentStatus_STARTING} | |||
} | |||
|
|||
lengthS := uint32(m.waitTime.Seconds()) | |||
lengthS := uint32(waitTime.Seconds()) | |||
buckets, err := m.getNewBuckets(ctx, lengthS) |
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 you can call settings here and pass them to the getNewBuckets
method, in that case, you will be able to support immediate change for waitTime
as well.
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.
Done.
current, prev, err := m.monitorCache.getStatMonitorExtended(ctx, m.q, m.pgsmNormalizedQuery) | ||
settings, err := m.getSettings() | ||
if err != nil { | ||
m.l.Errorf(err.Error()) |
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.
If we get an error here, shouldn't we stop the method and return an error?
The same below
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.
Good catch. Moved before line 245 in pgstatmonitor.go as you required above and added continue there.
return false, errors.New("failed to get pgsm_normalized_query property") | ||
} | ||
|
||
if s[key].Value == "yes" { |
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.
If I got it right this value might be "1" as well
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.
Yes string "1" for older versions. Thank you.
PMM-9632
Build: SUBMODULES-0