-
Notifications
You must be signed in to change notification settings - Fork 107
Conversation
39f8294
to
bb424c2
Compare
adjustedPoints["sum"] = make(map[uint32]float64) | ||
adjustedPoints := make(map[schema.Method]map[uint32]float64) | ||
if retIdx > 0 && c.method == schema.Avg || c.method == schema.Sum { | ||
adjustedPoints[schema.Cnt] = make(map[uint32]float64) |
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.
why do we keep a count aggregation if all the user wants is 'sum'?
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 that was because that way we can also serve average queries
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.
we should stop doing that. The "count" value we are storing will be wrong any time the original metrics stream had null points. eg, if the raw interval is 1min and their is a 10min SUM rollup, we cant assume that the sum is the result of 10 points. It could be the result of anywhere from 0-10 points.
But maybe we should address this problem in a followup PR.
79a8919
to
63bc54d
Compare
efe2dcd
to
84217de
Compare
mdata/cwr.go
Outdated
return errors.New(fmt.Sprintf("ERROR: Creating Gzip reader: %q", err)) | ||
} | ||
|
||
raw, err := ioutil.ReadAll(gzipReader) |
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.
There is no need to load the uncompressed data into memory, msgp can decode from a io.Reader directly.
eg,
err := msgp.Decode(gzipReader, a)
Thx for all the comments @woodsaj , will fix everything. What do you think about that I replaced the CLI flags with the same configuration method like what MT is using in 84217de? I figured that way it's going to be much easier to configure it from HM-API, because the majority of the store/index configs are just going to be the same as in the MT write deployments. |
I love it. |
b80bfd7
to
d2aaaf2
Compare
mdata/cwr.go
Outdated
versionBuf := make([]byte, 1) | ||
readBytes, err := b.Read(versionBuf) | ||
if err != nil || readBytes != 1 { | ||
return errors.New(fmt.Sprintf("ERROR: Failed to read one byte: %s", err)) |
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.
instead of errors.New(fmt.Sprintf(...
you can just use fmt.Errorf(
I first redeployed my test instance in the QA cluster and made it use BigTable as index & store, then I imported 5 test metrics from generated whisper files, after restarting the read MT they showed up correctly. |
just fix my last comment, |
@Dieterbe regarding the changes in the vendor dir. because now we need the |
oh! well, when i came up with schema.Archive, MKey, Key, etc my idea was that these would all be internal implementation details that could be changed at any time because their exact values would only stay inside of a process, and never be serialized and sent in network requests. For serialisation I think think we should use the string representation of the keys (e.g. 'orgid.deadbeef_sum_60'). this makes it easier to inspect them on the wire too |
That would mean we couldn't use |
you're conflating a struct and its serialized representation. |
@Dieterbe i think you're right, I'll try that |
@Dieterbe how's this: 39123b1 |
looks good, but there's 2 things left in schema that still need to be cleaned up: is it correct to say the only change in the schema library should be that we add msgp encoding to the AMKey (by serializing it to its string representation) ? Also, the commit history has lots of back and forth, can we "compact" the commits (via git rebase -i)
I suggest give it a shot, and see how far it can be cleaned up (i tend to do many runs of git rebase -i, each time squashing some commits together, until it becomes clear that i'll hit a merge conflict, or if i hit a merge conflict during rebasing i then just do |
9669930
to
d8d8891
Compare
I also fixed a typo in an error message and msgp generated a bunch of tests for that extension, otherwise that's right. If this PR is accepted I can create a PR to raintank/schema with those changes. There I can create separate commits for the typo and the msgp stuff. Then, once that's merged, we can just update the vendored I fixed up the git history. Usually I do that by just squashing all changes into one commit, then I go back and edit that commit and use either |
so why does your PR still introduce a bunch of other files like point_gen_test.go and metric_gen_test.go ? |
f5a6ed3
to
f8a3927
Compare
when transferring the data between the whisper-importer-reader and -writer we now use the same chunk write request type that metrictank uses internally when submitting writes to its stores. this makes it easier to add other store types to the importer-writer if we add more to metrictank in the future. futhermore, it modifies the chunk write requests so they include a callback to be called when a chunk has been written. this helps to decouple the mdata package from the store package by letting the instantiator of the chunk write request adding any generic callback to it.
this makes the configuration of the importer-writer consistent with the way how MT and other MT-tools are configured. this makes sense to do now because with the added support for the bigtable store and index the configuration would get too complex if we'd try to come up with a way to configure all of that via cli arguments, so its easier and more consistent to just do it in the same way like everything else.
@Dieterbe I cleaned it up, please take another look |
I found a critical bug and fixed it and added a test that covers it: it took me forever to find that, i only saw that some metrics looked weird because certain chunks which were supposed to be archive chunks overwrote some raw chunks, but not always.... after fixing it i did some more test imports with cassandra and bigtable backends, and it all looks fine |
yep please patch in schema so we can merge there, introduce here cleanly, and merge here. |
Modifies the whisper-importer-reader and writer utilities so they:
mdata.Store
interfaceUnfortunately some of the arguments that need to be passed to the writer had to be changed, so the invocation will need to be updated (HM-API).
It requires some of the data structures in github.com/raintank/schema to be msgp marshalable, which they currently aren't. Once this PR is accepted I'll create an according PR there.
This is not tested yet.
This already includes the PR #1290, once that one is merged this diff will be shorter