site updated with php for static data

This commit is contained in:
2026-03-17 23:56:09 -07:00
parent 61421305ed
commit fd7e0aaf31
6 changed files with 193 additions and 45 deletions

View File

@ -111,6 +111,11 @@ def redis_strings():
def full_summary():
return jsonify(get_full_summary())
# php summary
@app.route('/php_summary', methods=['GET'])
def php_summary():
return jsonify(get_php_summary())
# system info
@app.route('/info', methods=['GET'])
def info():
@ -169,12 +174,13 @@ def get_static_data(human_readable = False):
result = []
return cosmostat_system.get_static_metrics(human_readable)
# php is about to start rendering static data
def get_redis_data(human_readable = False):
result = []
for metric in get_dynamic_data(human_readable):
result.append(metric)
for metric in get_static_data(human_readable):
result.append(metric)
#for metric in get_static_data(human_readable):
# result.append(metric)
return result
def get_full_summary():
@ -212,6 +218,23 @@ def get_info():
# result[name] = description
return result
def get_php_summary():
system_properties = cosmostat_system.get_system_properties(human_readable = True)
system_components = []
for component in cosmostat_system.get_components():
this_component = {
"component_name": component.name,
"info_strings": component.get_properties_strings(return_simple = True)
}
system_components.append(this_component)
result = [{
"system_properties": system_properties,
"system_components": system_components
}]
return result
#######################################################################
### Other Functions
#######################################################################