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

Feature Request - Reuse init command for multiple charts #29

Open
allykzam opened this issue Aug 6, 2019 · 6 comments
Open

Feature Request - Reuse init command for multiple charts #29

allykzam opened this issue Aug 6, 2019 · 6 comments
Labels
enhancement New feature or request

Comments

@allykzam
Copy link

allykzam commented Aug 6, 2019

The example configuration suggests using an init command for things that require some initial setup, such as getting performance metrics from a database server. In some cases, multiple charts may be fetching data from the same source, so it would be convenient if the sample instance of an init command could be reused somehow. This would be useful for e.g. setting up charts for multiple production servers, separately showing CPU load and RAM usage, where both data sets are coming from the same data source.

@Asherslab
Copy link

very much already a thing: https://github.com/sqshq/sampler#variables

@allykzam
Copy link
Author

allykzam commented Aug 6, 2019

@Asherslab this just reuses the command path and arguments, it doesn't reuse the same instance of the init application. In the example I gave, showing both CPU load and RAM use, using a variable for init still causes two instances of the command to be run, in my case causing two separate connections to the same database server.

@drozdowsky
Copy link

drozdowsky commented Aug 6, 2019

Currently using sampler and I agree that global init looks like a must.
But.
Do we really have to have it in sampler? I think this can also can be handled by script/other app (that keeps session)

@sqshq sqshq added the enhancement New feature or request label Aug 7, 2019
@Asherslab
Copy link

true we could have it elsewhere. but having it in sampler would be nice
i'm sure adding a simple boolean to the variables part to share the same "session" would work fine

@allykzam
Copy link
Author

allykzam commented Aug 7, 2019

@drozdowsky: for my example of database connections, I did exactly that. I spent a half hour yesterday throwing together a windows service that responds to simple commands over the network. Now my init command for each data point is nc 127.0.0.1 1234, and they all reuse the same database connections.

While this definitely improves things for my company's database servers, it just moves the issue to my local system. Now I have 15 instances of sh -c $localconnection and 15 instances of nc 127.0.0.1 1234 running on my system.

@18829525501
Copy link

i agree with you.
usually i monitoring database status with some SELECT cmd, in most situation it is sufficient to create one DB connection, otherwise it will result resourses wasting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants