add more info to /rssi http page.

This commit is contained in:
gardners 2013-02-15 15:37:39 +10:30 committed by Jeremy Lakeman
parent d251f46638
commit 3bd4c49af5
3 changed files with 17 additions and 3 deletions

View File

@ -137,6 +137,15 @@ struct rhizome_fetch_queue rhizome_fetch_queues[] = {
#define NQUEUES NELS(rhizome_fetch_queues)
int rhizome_active_fetch_count()
{
int i,active=0;
for(i=0;i<NQUEUES;i++)
if (rhizome_fetch_queues[i].active.state!=RHIZOME_FETCH_FREE)
active++;
return active;
}
static struct sched_ent sched_activate = STRUCT_SCHED_ENT_UNUSED;
static struct profile_total fetch_stats;

View File

@ -526,15 +526,18 @@ int rhizome_server_parse_http_request(rhizome_http_request *r)
rhizome_server_http_response_header(r, 200, "image/vnd.microsoft.icon", favicon_len);
} else if (strcmp(path, "/rssi") == 0) {
r->request_type = RHIZOME_HTTP_REQUEST_FROMBUFFER;
char temp[8192];
char temp[8192];
snprintf(temp,8192,
"<head><meta http-equiv=\"refresh\" content=\"5\" >"
"</head><html><h1>Radio link margin = %+ddB<br>"
"Radio temperature = %d&deg;C<br>"
"SID: %s*"
"SID: %s*<br>"
"%d rhizome transfers in progress<br>"
"</h1></html>\n",
last_radio_rssi,last_radio_temperature,
alloca_tohex_sid(my_subscriber->sid));
alloca_tohex_sid(my_subscriber->sid),
rhizome_active_fetch_count()
);
rhizome_server_simple_http_response(r, 200, temp);
} else if (strcmp(path, "/rhizome/groups") == 0) {
/* Return the list of known groups */

View File

@ -858,4 +858,6 @@ uint32_t Crc32_ComputeBuf( uint32_t inCrc32, const void *buf,
size_t bufLen );
extern int last_radio_rssi;
extern int last_radio_temperature;
int rhizome_active_fetch_count();
#endif // __SERVALD_SERVALD_H