Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

Client should test for invalid data #71

Closed
radiospiel opened this issue Jul 21, 2013 · 2 comments
Closed

Client should test for invalid data #71

radiospiel opened this issue Jul 21, 2013 · 2 comments

Comments

@radiospiel
Copy link

In the spirit of #69 the client should already test if some data is invalid to prevent it from being sent to the server in the first place. I stumbled across a coding error where I sent much more data to the server as intended, and the librato server correctly returned an error ("metrics is configured as a counter, but..".

I guess this error could have been raised from the gem already, without the roundtrip.

@nextmat
Copy link
Contributor

nextmat commented Jul 22, 2013

@radiospiel The challenge with doing the specific kind of validation client-side you suggest is that the client side does not have stateful knowledge of the kind of metric you submitted with that name previously. So to validate it would have to do a query on all the metrics you were about to submit per submission which would significantly degrade performance.

I'm definitely open to other options for client-side validation though if you have them.

I've tried to strike a balance between validations that can be performed quickly client-side vs the performance impact of more heavy validations. The gem is used in a lot of places where performance really matters so I always weigh that in adding features.

@nextmat
Copy link
Contributor

nextmat commented Aug 1, 2013

Let me know if you have further thoughts on this, closing for now.

@nextmat nextmat closed this as completed Aug 1, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants