Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladislavs Sokurenko <vladislavs.sokurenko@zabbix.com>2020-04-20 16:12:17 +0300
committerVladislavs Sokurenko <vladislavs.sokurenko@zabbix.com>2020-04-20 16:12:17 +0300
commit9c7a31a3e9d8bed4aa0259c453dd4ade7e8e6e97 (patch)
treeec9b034defa1d8f521961b68e4df2ea49b1516a8 /src/libs/zbxembed/zabbix.c
parentb5bb46bd006f66f4f6fa832718cc84d535269c7b (diff)
........S. [ZBXNEXT-5877] added duration of the script
Diffstat (limited to 'src/libs/zbxembed/zabbix.c')
-rw-r--r--src/libs/zbxembed/zabbix.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/libs/zbxembed/zabbix.c b/src/libs/zbxembed/zabbix.c
index 14ffff0ed14..ac30da2d6a9 100644
--- a/src/libs/zbxembed/zabbix.c
+++ b/src/libs/zbxembed/zabbix.c
@@ -70,7 +70,6 @@ static duk_ret_t es_zabbix_log(duk_context *ctx)
const char *message;
int level;
duk_memory_functions out_funcs;
- struct timeval tv;
level = duk_to_int(ctx, 0);
message = duk_to_string(ctx, 1);
@@ -86,9 +85,7 @@ static duk_ret_t es_zabbix_log(duk_context *ctx)
zbx_json_addobject(env->json, NULL);
zbx_json_adduint64(env->json, "level", (zbx_uint64_t)level);
- gettimeofday(&tv, NULL);
- zbx_json_adduint64(env->json, "ms", (tv.tv_sec - env->start_time.tv_sec) * 1000 +
- (tv.tv_usec - env->start_time.tv_usec) / 1000);
+ zbx_json_adduint64(env->json, "ms", zbx_get_duration(env->start_time));
zbx_json_addstring(env->json, "message", message, ZBX_JSON_TYPE_STRING);
zbx_json_close(env->json);