Skip to content
This repository has been archived by the owner on Aug 22, 2018. It is now read-only.

Add support for gauges. #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add support for gauges. #10

wants to merge 1 commit into from

Conversation

kjoconnor
Copy link

I apologize in advance for bad Go

👓 @spladug @dforsyth

@dforsyth
Copy link

Nothing in here looks heinous to me, but I don't know much about tallier.

Side note, in the future it might be a good idea to separate gofmt changes for existing code into a separate commit (and even have precommit hooks that check formatting).

🐟

@spladug
Copy link
Contributor

spladug commented Aug 21, 2015

Side note, in the future it might be a good idea to separate gofmt changes for existing code into a separate commit (and even have precommit hooks that check formatting).

Very 👍

@@ -28,6 +29,7 @@ type Sample struct {
valueType SampleType
sampleRate float64
stringValue string
replace bool
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This guy kinda bums me out. Is there a way to make the booleans more obvious elsewhere? It's really hard for me to know when seeing a structure instantiated what false being the last parameter means.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed in person, perhaps just having true/false variants of the gauge functions rather than taking a boolean would be a more readable approach.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On further thought, I think we could do this by having a value type of GAUGE_REPLACE and GAUGE_MODIFY which could then trigger different codepaths. This allows us to dodge adding another field onto the Sample struct which is the cause for so many noisy updates in the tests etc.

@spladug
Copy link
Contributor

spladug commented Aug 21, 2015

💅 question about boolean readability

replace = false
value, _ = ParseFloat(sample)

if _, err := strconv.Atoi(string(sample[0])); err == nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at this further, this is icking me out a bit: is this trying to figure out if the first character is a + or - by seeing if that character by itself can be turned into an integer?

@spladug
Copy link
Contributor

spladug commented Mar 17, 2016

re-:nail_care: just for the heck of it. Was looking at merging this patch and found some issues while digging in. Whatcha think?

@spladug spladug mentioned this pull request Mar 17, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants