-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add more statistics and /status.json page #40
base: master
Are you sure you want to change the base?
Conversation
Great @freddy36 ! This will be useful. Perhaps you want also to complete the code about the UDP listening COMMAND from here: lars18th@e38fb3b |
Hi @freddy36 , Perhaps you want to add one compile option to enable/disable the JSON code. I feel it will be useful to compile this tool without the JSON dependency in some small environments. You agree? |
What kind of commands do you intend to send via UDP? For functions like modifying inputs, etc. we probably would prefer a REST API over a UDP command API. In general I try to avoid having compile time options. If someone really is running mptsd in a heavily storage/memory constraint environment, it's easy to add. But unless requested by @gfto we're not planning to add it. |
At minimum the libjson-c dep should be optional and enabled via Far better (since the library is only used to generate output) is to avoid the dependency. The generated output json does not look that complex. |
Hi @freddy36 , I have this suggestion:
I feel that this part of the code from tomcast could be reused. |
127b83f
to
bd50d80
Compare
updated the PR |
@gfto is this ok for you now or would you like to see any other changes? |
@gfto do you have any otehr change request/other feedback regading this pull request? |
Hi @freddy36 i cannot compile this, this is the error: LINK libfuncs.a
MAKE libtsfuncs/libtsfuncs.a
LINK libtsfuncs.a
CC mptsd iniparser.c
CC mptsd inidict.c
CC mptsd pidref.c
CC mptsd data.c
CC mptsd config.c
CC mptsd sleep.c
CC mptsd network.c
CC mptsd input.c
CC mptsd output_psi.c
CC mptsd output_mix.c
CC mptsd output_write.c
CC mptsd web_pages.c
web_pages.c: In function ‘cmd_status_json’:
web_pages.c:314:9: warning: implicit declaration of function ‘send_header_applicationjson’ [-Wimplicit-function-declaration]
314 | send_header_applicationjson(clientsock);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
web_pages.c:334:9: warning: implicit declaration of function ‘send_header_content_length’ [-Wimplicit-function-declaration]
334 | send_header_content_length(clientsock, length);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
web_pages.c:336:29: warning: passing argument 2 of ‘fdwrite’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
336 | fdwrite(clientsock, jbuf, length);
| ^~~~
In file included from web_pages.c:29:
libfuncs/io.h:29:31: note: expected ‘char *’ but argument is of type ‘const char *’
29 | ssize_t fdwrite(int fd, char *buf, size_t buf_size);
| ~~~~~~^~~
CC mptsd web_server.c
CC mptsd mptsd.c
LINK mptsd
/usr/bin/ld: web_pages.o: en la función `cmd_status_json':
/home/usuario/sources/mptsd_stats/mptsd/web_pages.c:314: referencia a `send_header_applicationjson' sin definir
/usr/bin/ld: /home/usuario/sources/mptsd_stats/mptsd/web_pages.c:334: referencia a `send_header_content_length' sin definir
collect2: error: ld returned 1 exit status
make: *** [Makefile:68: mptsd] Error ```
Any sugestion?
Regards,
|
Go to the libfuncs directory and git pull the latest version: |
No description provided.