Comments (8)
while at it, I recommend renaming it to simply 'data' per ruby conventions. (the get/set_X is less popular in ruby)
from hawkular-client-ruby.
I was looking into it and it is actually using hash. There is a difference between
def get_data(id, starts: nil, ends: nil, bucketDuration: nil, buckets: nil, percentiles: nil, limit: nil, order: nil)
and
def get_data(id, starts = nil, ends = nil, bucketDuration = nil, buckets = nil, percentiles = nil, limit = nil, order = nil)
Both methods takes the id as a first param. The difference here is that the second method can accept optional parameters, but it's an ordered list, so if I wan't to specify, say, buckets
, but don't want to specify anything else, I have no way to do that.
The second signature is different, the order doesn't matter, because technically the method accept an id and a hash. I can call the first method as
get_data(42, starts: now - (2 *foo), ends: now - foo)
or even
additional_params = {
start: foo,
end: bar,
order: baz
}
get_data(42, additional_params)
note: Ruby doesn't allow to call the 2nd method this way get_data(42, now - (2 *foo), now - foo)
. I.e. w/o explicitly naming the params in the hash.
So i think, we are good here as for the hash and passing the arguments. Correct, me if I am wrong or missing something.
So what about the get_data
-> data
renaming, does it worth to break the api?
from hawkular-client-ruby.
Oh, and it's Ruby 2+ feature, but it shouldn't be the issue (https://robots.thoughtbot.com/ruby-2-keyword-arguments)
from hawkular-client-ruby.
So I hear you saying @Jiri-Kremser this is no issue and already works? If so, could you add some tests please that use this alternate style to make sure it continues to work in the future?
from hawkular-client-ruby.
this was the original:
def get_data(id, starts: nil, ends: nil, bucketDuration: nil, buckets: nil)
and this is the new version:
def get_data(id, starts: nil, ends: nil, bucketDuration: nil, buckets: nil, percentiles: nil, limit: nil, order: nil)
This is not a breaking change. I think, it's well tested (https://git.io/vrJIm) but I can add a case for get_data
being called with all the possible arguments.
from hawkular-client-ruby.
from hawkular-client-ruby.
@abonas "So what about the get_data -> data renaming, does it worth to break the api?"
from hawkular-client-ruby.
@pilhuhn regarding breaking the api - it depends how many users the ruby client has. if only 1 and we know who, and it's one place to rename - I'd go ahead and rename it.
in any case there's also an option to do "alias_method" and document the "new" method name, that won't break a thing.
from hawkular-client-ruby.
Related Issues (20)
- Return a more complete operation definition from inventory
- Another gsub does not work on URL issue HOT 8
- List operations sometimes fails
- get operation parameters via the official inventory way
- Add support for rates on query_stats mapping
- Support string metrics
- Allow to list tags in hawkular-metrics HOT 1
- ackBy no longer exists on alerts HOT 1
- Tenant handing in h-metrics 0.20 has changed
- Remove specs context metrics_0_16_ and leave only metric_services and metrics_0_8_0
- Add Test cases for XA Datasource to Datasource Add
- Add 'interval' field of alert conditions
- Add an option to query metrics based on tag only (regardless to type) HOT 2
- Support for multi-tenant operations HOT 6
- @inv_client.create_resource does not return path when resource already exists
- Add support for activesupport gem? HOT 12
- Consider replacing the websocket-client-simple gem with the same gem that is being used in the MiQ HOT 1
- Consider dropping support for v0.8 metrics HOT 5
- hawkular-website-bot's gh token lost the rights to push to the repo
- Incompatible with rest-client 2.1.0.rc1 ? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hawkular-client-ruby.