Giter VIP home page Giter VIP logo

Comments (5)

louism517 avatar louism517 commented on July 25, 2024

@chengwang86

Yes, we'd be happy to accept a PR with this functionality. Thanks.

from go-wavefront.

chengwang86 avatar chengwang86 commented on July 25, 2024

@louism517

In addition, can I add two more features to my PR?

  1. According to the API,
QueryResult {
warnings (string, optional): The warnings incurred by this query ,
name (string, optional): The name of this query ,
query (string, optional): The query used to obtain this result ,
timeseries (Array[Timeseries], optional),
stats (StatsModel, optional),
events (Array[QueryEvent], optional),
granularity (integer, optional): The granularity of the returned results, in seconds
}

I would like to add warnings as an attribute to the queryResponse struct https://github.com/spaceapegames/go-wavefront/blob/master/query.go#L72
This will be helpful for debugging purposes. For example, sometiimes the returned Timeseries is empty and the warnings tell you the reason, even if the response.statuscode is still 200 (query succeeded).

  1. The Execute() function (https://github.com/spaceapegames/go-wavefront/blob/master/query.go#L127) doesn't check the response statuscode. I want to update this function so that it returns an error with the response message as a string if the statuscode is not 200.

from go-wavefront.

louism517 avatar louism517 commented on July 25, 2024

Those both sound like great ideas. Look forward to your PR.

from go-wavefront.

chengwang86 avatar chengwang86 commented on July 25, 2024

@louism517 Here is my PR #11

I just noticed that the http statuscode was already handled properly in client.go. So I didn't make any changes to the Execute() function.

from go-wavefront.

chengwang86 avatar chengwang86 commented on July 25, 2024

close it per PR #11

from go-wavefront.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.