Comments (5)
What do you mean by "one trade 100% for 20 seconds"? Are you saying that diamond occasionally takes 20 seconds? My guess is the netstat -ant
is taking a long time. How many connections are you typically working with?
from diamond.
Also please note that development of diamond has moved to https://github.com/python-diamond/Diamond
from diamond.
Im executing this script it takes 2 sec
When i'm putting same same code to dimond class it using CPU a lot
#!/usr/bin/python
from decimal import *
import commands
import diamond.collector
all_connections = commands.getoutput("netstat -ant")
connection_list = {"ESTABLISHED" : 0 , "SYN_SENT" : 0 , "SYN_RECV" : 0 , "FIN_WAIT1" : 0 , "FIN_WAIT2" : 0 , "TIME_WAIT" : 0 , "CLOSE" : 0 , "CLOSE_WAIT" : 0 , "LAST_ACK" : 0 , "LISTEN" : 0 , "CLOSING" : 0 , "UNKNOWN" : 0 }
for line in all_connections.splitlines():
#print line
if line.find("ESTABLISHED") != -1:
#print "ESTABLISHED"
connection_list["ESTABLISHED"]+=1
elif line.find("SYN_SENT") != -1:
#print "SYN_SENT"
connection_list["SYN_SENT"]+=1
elif line.find("SYN_RECV") != -1:
#print "SYN_RECV"
connection_list["SYN_RECV"]+=1
elif line.find("FIN_WAIT1") != -1:
#print "FIN_WAIT1"
connection_list["FIN_WAIT1"]+=1
elif line.find("FIN_WAIT2") != -1:
#print "FIN_WAIT2"
connection_list["FIN_WAIT2"]+=1
elif line.find("TIME_WAIT") != -1:
#print "TIME_WAIT"
connection_list["TIME_WAIT"]+=1
elif line.find("CLOSE") != -1:
#print "CLOSE"
connection_list["CLOSE"]+=1
elif line.find("CLOSE_WAIT") != -1:
#print "CLOSE_WAIT"
connection_list["CLOSE_WAIT"]+=1
elif line.find("LAST_ACK") != -1:
#print "LAST_ACK"
connection_list["LAST_ACK"]+=1
elif line.find("LISTEN") != -1:
#print "LISTEN"
connection_list["LISTEN"]+=1
elif line.find("CLOSING") != -1:
#print "CLOSING"
connection_list["CLOSING"]+=1
elif line.find("UNKNOWN") != -1:
#print "UNKNOWN"
connection_list["UNKNOWN"]+=1
print "ESTABLISHED : " , connection_list["ESTABLISHED"]
print "SYN_SENT : " , connection_list["SYN_SENT"]
print "SYN_RECV : " , connection_list["SYN_RECV"]
print "FIN_WAIT1 : " , connection_list["FIN_WAIT1"]
print "FIN_WAIT2 : " , connection_list["FIN_WAIT2"]
print "TIME_WAIT : " , connection_list["TIME_WAIT"]
print "CLOSE : " , connection_list["CLOSE"]
print "CLOSE_WAIT : " , connection_list["CLOSE_WAIT"]
print "LAST_ACK : " , connection_list["LAST_ACK"]
print "LISTEN : " , connection_list["LISTEN"]
print "CLOSING : " , connection_list["CLOSING"]
print "UNKNOWN : " , connection_list["UNKNOWN"]
from diamond.
@rubenpapovyan there really shouldn't be any reason why diamond would use more resources than a standalone script. You might have to paste your entire config for a better understanding. How are you integrating your script? As a custom collector or as a script in the UserScriptCollector?
from diamond.
This repo has moved to https://github.com/python-diamond/Diamond
Please open a new ticket there if this issue is not resolved with the current code there.
Thanks!
from diamond.
Related Issues (20)
- please add more per-node metrics to ElasticSearchCollector HOT 1
- MongoDBCollector auth issue pymongo 3.0.3 HOT 5
- Document threading HOT 3
- Doesn't work in python3.5 HOT 1
- BrightcoveOs/Diamond Libvirtkvm Collector is Not working In KVM Hypervisor HOT 1
- Load averages do not contain scaled versions
- Unable to send solrColletor data to graphite HOT 3
- RedisCollector: failed to connect to localhost:6379. __init__() got an unexpected keyword argument 'unix_socket_path'. HOT 2
- Error: I/O operation in RabbitMQ Collector HOT 1
- CPU collector not precise HOT 2
- ElasticSearch collector doesn't work on ElasticSearch 2.0 HOT 2
- cephstats.py not support ceph version 10.2.2 HOT 1
- Start in SUSE error HOT 5
- Missing PuppetDBCollector example HOT 1
- Diamond not getting started HOT 2
- mongodb collector is not working HOT 2
- ProcessStatCollector must not calculate derivative of procs_running and procs_blocked HOT 2
- Change project description to say about depreciation HOT 1
- Building deb package from source 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 diamond.