-
Notifications
You must be signed in to change notification settings - Fork 35
Conversation
5994436
to
ed8796f
Compare
Implement an influx client extenstion that allows for direct serialization to a struct instead of needing to traverse the result and build it by hand. Ex: ```rust struct MgsFsTime { time: u64, } let xs: Vec<MgsFsTime> = client .query_into( format!( r#" SELECT mgs_fs,is_mgs_fs FROM target WHERE mgs_fs='{}' AND is_mgs_fs=true ORDER BY time ASC LIMIT 2"#, fs_names ) .as_str(), Some(Precision::Nanoseconds), ) .await? .unwrap_or_default(); ``` Signed-off-by: Joe Grund <jgrund@whamcloud.io>
ed8796f
to
a12126d
Compare
The current targets table is intermittently losing it's filesystems for
some targets.
This appears to be because we delete stat info before inserting the next
batch. If anyone queries during this gap, they will get empty data even
though we have the points, they just haven't been inserted yet.
In addition, we are clearing out all stats except a single point for any target colocated on the MGS node.
This patch waits until after insertion to do a deletion, and scopes the
delete so it should only effect the correct stat.
Fixes #2258.
Signed-off-by: Joe Grund <jgrund@whamcloud.io>
2a91607
to
b806a9b
Compare
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.
Reviewed 8 of 8 files at r1.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @jgrund)
iml-services/iml-stats/src/main.rs, line 496 at r1 (raw file):
let entries: Vec<_> = xs .into_iter() .inspect(|x| {
I'd expect inspect
to not mutate, maybe map
?
iml-services/iml-stats/src/main.rs, line 551 at r1 (raw file):
WHERE mgs_fs='{}' AND is_mgs_fs=true ORDER BY time ASC LIMIT 2"#,
Why LIMIT 2
?
iml-services/iml-stats/src/main.rs, line 496 at r1 (raw file): Previously, mkpankov (Michael Pankov) wrote…
it is not mutating the contained value, it's purely there for the side-effect of mutating fs_names, which is not associated with the combinator. |
iml-services/iml-stats/src/main.rs, line 551 at r1 (raw file): Previously, mkpankov (Michael Pankov) wrote…
because if there is 1 or 0 it's a noop. |
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.
Reviewable status: complete! all files reviewed, all discussions resolved
The current targets table is intermittently losing it's filesystems for
some targets.
This appears to be because we delete stat info before inserting the next
batch. If anyone queries during this gap, they will get empty data even
though we have the points, they just haven't been inserted yet.
In addition, we are clearing out all stats except a single point for any target colocated on the MGS node.
This patch waits until after insertion to do a deletion, and scopes the
delete so it should only effect the correct stat.
Fixes #2258.
Signed-off-by: Joe Grund jgrund@whamcloud.io
This change is