Skip to content

Commit

Permalink
Fix metrics decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
kysre committed Feb 11, 2024
1 parent 0c152d4 commit 2d355dc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions datanode/src/datanode_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,13 @@ def wrapper(*args, **kwargs):


def get_disk_info_decorator(func):
def wrapper():
result = func()
def wrapper(*args, **kwargs):
path = ConfigManager.get_prop('partition_home_path')
st = os.statvfs(path)
total = st.f_blocks * st.f_frsize
used = (st.f_blocks - st.f_bfree) * st.f_frsize
disk_total_size.labels(provider=ConfigManager.get_prop('datanode_name')).set(total)
disk_total_size.labels(provider=ConfigManager.get_prop('datanode_name')).set(used)
return result
return wrapper


Expand Down Expand Up @@ -173,6 +171,7 @@ def push_to_partition(partition_index: int,


def serve():
# Start metrics server
start_http_server(9000)

port = ConfigManager.get_prop('server_port')
Expand Down

0 comments on commit 2d355dc

Please sign in to comment.