Comments (7)
Hi @aimbot31
I'll post your comment from MR here:
I was thinking about adding a -t option to specify where the template file is located, then generate a yml file in the same directory, so the position and size can be updated properly.
The size and location are not supposed to be updated manually, it is inconvenient to do it that way. User can click/select any component and move/resize through UI.
Also there is the auto-position functionality, which automatically calculates size and location for a newly added component without position
specified, to fit it in the best place on the existing dashboard. If there is not much space between existing components, the biggest component size will be reduced twice. All configurations in README do not have position
- user just should not worry about it
from sampler.
Thanks for your comment, i think i didn't express myself correctly,
I was thinking about adding a -t option to specify where the template file is located, then generate a yml file in the same directory, so the position and size can be updated properly by the program.
If we run the config with the -c
flag, it will work well, but when we will quit, it will erase our template yaml and write only yaml to update the position. That's why i thought about adding a -t
option to the cli to specify where to find the template, then generate a yaml in the same directory and then use it.
Don't hesitate to comment if i'm not clear enough.
from sampler.
@sqshq up
from sampler.
Hey @aimbot31,
I'm still not quite sure why it can be useful for a user. Could you please give an example, with a template and it's usecase?
from sampler.
Hi @sqshq,
For example with this configuration :
- title: K8S Node Ram Usage
position: [[0, 20], [40, 20]]
rate-ms: 5000
legend:
enabled: true
details: false
scale: 0
items:
- label: node1
color: 178
sample: kubectl top nodes | awk 'NR==2 {printf "%d", $5}'
- label: node2
sample: kubectl top nodes | awk 'NR==3 {printf "%d", $5}'
- label: node4
sample: kubectl top nodes | awk 'NR==4 {printf "%d", $5}'
triggers:
- title: RAM usage exceeded
condition: echo "$cur > 80" |bc -l
actions:
terminal-bell: true
sound: true
visual: true
script: 'say alert: ${label} : RAM exceeded ${cur}% of usage'
- title: K8S Node CPU Usage
position: [[40, 20], [40, 20]]
rate-ms: 5000
legend:
enabled: true
details: false
scale: 0
items:
- label: node1
color: 178
sample: kubectl top nodes | awk 'NR==2 {printf "%d", $3}'
- label: node2
sample: kubectl top nodes | awk 'NR==3 {printf "%d", $3}'
- label: node4
sample: kubectl top nodes | awk 'NR==4 {printf "%d", $3}'
triggers:
- title: CPU usage exceeded
condition: echo "$cur > 80" |bc -l
actions:
terminal-bell: true
sound: true
visual: true
script: 'say alert: ${label} : CPU exceeded ${cur}% of usage'
textboxes:
- title: Kubernetes events
position: [[0, 0], [80, 20]]
rate-ms: 3000
color: 211
sample: kubectl get events -A | grep -e "Failed" -e "NAMESPACE"
You cannot make it generic because you have to know how many nodes are present on the kubernetes cluster. The template can be useful in that case. For example :
- title: K8S Node Ram Usage
position: [[0, 20], [40, 20]]
rate-ms: 5000
legend:
enabled: true
details: false
scale: 0
items:
{{ range index, node := nodes }}
- label: node
color: 178
sample: kubectl top nodes | awk 'NR=={{ .node + 2 }} {printf "%d", $5}'
{{ end }}
triggers:
- title: RAM usage exceeded
condition: echo "$cur > 80" |bc -l
actions:
terminal-bell: true
sound: true
visual: true
script: 'say alert: ${label} : RAM exceeded ${cur}% of usage'
from sampler.
Hey @aimbot31, sorry for the delayed response, I'm on vacation right now.
How do you propose to pass data to the template (nodes
variable in your example)? Also, do you want user to specify a config file name (which will be generated based on the template), or create it automatically (e.g. k8s-template.yaml
> k8s-template-config.yaml
)
from sampler.
Hey @sqshq, I hope your vacations are going well,
"How do you propose to pass data to the template "
This is really the main problem actually.. I'm still thinking about it..
For your second question :
The second option is what I was expecting, you specify the template and then it will generate the config in the same dir.
from sampler.
Related Issues (20)
- Sampler freezes after spawing a lot of processes (on server)
- Feature request: Dynamic items or Dictionnary items
- Variables unavailable in trigger conditions HOT 2
- Why $label rotation in conditions? HOT 3
- Failed to parse a number HOT 1
- Possibility to use deltas between samples
- Macos ssh pty error HOT 8
- Strange behavior on asciiboxes > sample command not well interpreted (bad yaml ?) HOT 1
- :grey_question: Layout question (jq | column) inside textboxes (deal with t ad \t)
- wrong results of sample commands
- Conditional color for textbox
- textbox keeps previous output after getting empty result from jq
- 500th fork!
- Configuration Error Ubuntu 21.10 HOT 1
- how to show two digit number in windows? HOT 1
- Can no longer compile from Source - Missing oto HOT 2
- Vulnerability of dependency "gopkg.in/yaml.v3"
- windows textboxes newline not working
- Paycode
- Cmder: bad link on website HOT 1
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 sampler.