Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All tasks stats #321

Closed
yosiat opened this issue Mar 12, 2016 · 1 comment
Closed

All tasks stats #321

yosiat opened this issue Mar 12, 2016 · 1 comment

Comments

@yosiat
Copy link
Contributor

yosiat commented Mar 12, 2016

Hi,

I am currently building UI for Kapacitor (that I hope to release in a month) and I am showing a list of all tasks.
I want to add to each task the number of points he processed and how much he outputed (points written or alerts triggered).

In the current api it will be slow, because I will need to fetch all tasks (using "/tasks") and fetch each task and parse it's dot file. and I want to do this every 10 seconds or something.

So I thoought about adding to "/tasks" something like this:

{
    Name: "cpu_alert",
    Type: 0,
    DBRPs: [{
        db: "kapacitor_example",
        rp: "default"
    }],
    Enabled: true,
    Executing: true,
    ExecutionStats: {
        Inputs: {
            stream1: 234
        },
        Outputs: {
            alert1: 298,
            influxdbout: 12
        }
    }
}

Where the Inputs and Outputs are key value of how much they emitted.
I digged to the source code and found a way to do so, but I am not sure about this, and I want OK before I code it out.

  1. I need node to export how much they emitted - and this can be calculated by the summing the "emitted" in Edge statsMap.
  2. Add to ExecutingTask function that will return "ExecutionStats" struct that will:
    • Input nodes:
      1. Find them all by checking their type StreamNode/ BatchNode
      2. Get their value - by summing the edge outs emitted
    • Output nodes:
      1. Find the output nodes by the next predicate: node that have parents and doesn't have child nodes.
      2. Expose function on "Node" (is this the right place) - that will return how much their outputed

@nathanielc What do you think? am I in the right direction?

@yosiat
Copy link
Contributor Author

yosiat commented Mar 12, 2016

Moving discussion to the pull request #323

@yosiat yosiat closed this as completed Mar 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant