Giter Club home page Giter Club logo

fastdfs-exporter's People

Contributors

whithen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fastdfs-exporter's Issues

higher version of fastdfs shows different type of value on total storage

higher version of fastdfs's fdfs_monitor output:

[root@hlet-fastdfs-tracker01 src]# fdfs_monitor /etc/fdfs/client.conf
server_count=1, server_index=0

tracker server is 10.1.99.34:22122

group count: 1

Group 1:
group name = group1
disk total space = 18,251,534 MB
disk free space = 18,251,251 MB
trunk free space = 0 MB
storage server count = 2
active server count = 2
storage server port = 23000
storage HTTP port = 8888
store path count = 1
subdir count per path = 256
current write server index = 1
current trunk file id = 0

need add a line before get the storage size:

result = (re.sub(r'[^\w\s]', '', str(value)))

数据格式化

def formatValue(value):
try:
# 匹配join time = 2019-04-04 17:00:49
result = re.findall("(\d+-\d+-\d+ \d+:\d+:\d+)", value)
if result:
timeStamp = time.mktime(datetime.datetime.strptime(result[0], "%Y-%m-%d %H:%M:%S").timetuple())
value = float(timeStamp)
# 匹配total storage = 1007799 MB
result = (re.sub(r'[^\w\s]', '', str(value))) # 添加这一行
result = re.findall("(\d+) MB$", result)
if result: value = float(result[0]) * 1024 * 1024
# 匹配ip_addr = 10.42.3.244 ACTIVE
result = re.findall("(\d+.\d+.\d+.\d+).+[A-Z]+", value)
if result:
if "ACTIVE" in value:
value = 1
else:
value = 0
# result = re.findall("(\d+)", value)
# if result: value = float(value)
except:
raise
finally:
return value

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.