@@ -85,7 +85,7 @@ int fpm_status_export_to_zval(zval *status)
85
85
add_assoc_long (status , "start-time" , scoreboard .start_epoch );
86
86
add_assoc_long (status , "start-since" , now_epoch - scoreboard .start_epoch );
87
87
add_assoc_long (status , "accepted-conn" , scoreboard .requests );
88
- #ifdef HAVE_FPM_LQ
88
+ #if HAVE_FPM_LQ
89
89
add_assoc_long (status , "listen-queue" , scoreboard .lq );
90
90
add_assoc_long (status , "max-listen-queue" , scoreboard .lq_max );
91
91
add_assoc_long (status , "listen-queue-len" , scoreboard .lq_len );
@@ -103,7 +103,7 @@ int fpm_status_export_to_zval(zval *status)
103
103
continue ;
104
104
}
105
105
proc_p = & procs [i ];
106
- #ifdef HAVE_FPM_LQ
106
+ #if HAVE_FPM_LQ
107
107
/* prevent NaN */
108
108
if (procs [i ].cpu_duration .tv_sec == 0 && procs [i ].cpu_duration .tv_usec == 0 ) {
109
109
cpu = 0. ;
@@ -130,7 +130,7 @@ int fpm_status_export_to_zval(zval *status)
130
130
add_assoc_long (& fpm_proc_stat , "request-length" , procs [i ].content_length );
131
131
add_assoc_string (& fpm_proc_stat , "user" , procs [i ].auth_user [0 ] != '\0' ? procs [i ].auth_user : "-" );
132
132
add_assoc_string (& fpm_proc_stat , "script" , procs [i ].script_filename [0 ] != '\0' ? procs [i ].script_filename : "-" );
133
- #ifdef HAVE_FPM_LQ
133
+ #if HAVE_FPM_LQ
134
134
add_assoc_double (& fpm_proc_stat , "last-request-cpu" , procs [i ].request_stage == FPM_REQUEST_ACCEPTING ? cpu : 0. );
135
135
#endif
136
136
add_assoc_long (& fpm_proc_stat , "last-request-memory" , procs [i ].request_stage == FPM_REQUEST_ACCEPTING ? procs [i ].memory : 0 );
@@ -245,7 +245,7 @@ int fpm_status_handle_request(void) /* {{{ */
245
245
"<tr><th>start time</th><td>%s</td></tr>\n"
246
246
"<tr><th>start since</th><td>%lu</td></tr>\n"
247
247
"<tr><th>accepted conn</th><td>%lu</td></tr>\n"
248
- #ifdef HAVE_FPM_LQ
248
+ #if HAVE_FPM_LQ
249
249
"<tr><th>listen queue</th><td>%d</td></tr>\n"
250
250
"<tr><th>max listen queue</th><td>%d</td></tr>\n"
251
251
"<tr><th>listen queue len</th><td>%u</td></tr>\n"
@@ -275,7 +275,7 @@ int fpm_status_handle_request(void) /* {{{ */
275
275
"<th>content length</th>"
276
276
"<th>user</th>"
277
277
"<th>script</th>"
278
- #ifdef HAVE_FPM_LQ
278
+ #if HAVE_FPM_LQ
279
279
"<th>last request cpu</th>"
280
280
#endif
281
281
"<th>last request memory</th>"
@@ -294,7 +294,7 @@ int fpm_status_handle_request(void) /* {{{ */
294
294
"<td>%zu</td>"
295
295
"<td>%s</td>"
296
296
"<td>%s</td>"
297
- #ifdef HAVE_FPM_LQ
297
+ #if HAVE_FPM_LQ
298
298
"<td>%.2f</td>"
299
299
#endif
300
300
"<td>%zu</td>"
@@ -317,7 +317,7 @@ int fpm_status_handle_request(void) /* {{{ */
317
317
"<start-time>%s</start-time>\n"
318
318
"<start-since>%lu</start-since>\n"
319
319
"<accepted-conn>%lu</accepted-conn>\n"
320
- #ifdef HAVE_FPM_LQ
320
+ #if HAVE_FPM_LQ
321
321
"<listen-queue>%d</listen-queue>\n"
322
322
"<max-listen-queue>%d</max-listen-queue>\n"
323
323
"<listen-queue-len>%u</listen-queue-len>\n"
@@ -346,7 +346,7 @@ int fpm_status_handle_request(void) /* {{{ */
346
346
"<content-length>%zu</content-length>"
347
347
"<user>%s</user>"
348
348
"<script>%s</script>"
349
- #ifdef HAVE_FPM_LQ
349
+ #if HAVE_FPM_LQ
350
350
"<last-request-cpu>%.2f</last-request-cpu>"
351
351
#endif
352
352
"<last-request-memory>%zu</last-request-memory>"
@@ -367,7 +367,7 @@ int fpm_status_handle_request(void) /* {{{ */
367
367
"\"start time\":%s,"
368
368
"\"start since\":%lu,"
369
369
"\"accepted conn\":%lu,"
370
- #ifdef HAVE_FPM_LQ
370
+ #if HAVE_FPM_LQ
371
371
"\"listen queue\":%d,"
372
372
"\"max listen queue\":%d,"
373
373
"\"listen queue len\":%u,"
@@ -397,7 +397,7 @@ int fpm_status_handle_request(void) /* {{{ */
397
397
"\"content length\":%zu,"
398
398
"\"user\":\"%s\","
399
399
"\"script\":\"%s\","
400
- #ifdef HAVE_FPM_LQ
400
+ #if HAVE_FPM_LQ
401
401
"\"last request cpu\":%.2f,"
402
402
#endif
403
403
"\"last request memory\":%zu"
@@ -417,7 +417,7 @@ int fpm_status_handle_request(void) /* {{{ */
417
417
"start time: %s\n"
418
418
"start since: %lu\n"
419
419
"accepted conn: %lu\n"
420
- #ifdef HAVE_FPM_LQ
420
+ #if HAVE_FPM_LQ
421
421
"listen queue: %d\n"
422
422
"max listen queue: %d\n"
423
423
"listen queue len: %u\n"
@@ -444,7 +444,7 @@ int fpm_status_handle_request(void) /* {{{ */
444
444
"content length: %zu\n"
445
445
"user: %s\n"
446
446
"script: %s\n"
447
- #ifdef HAVE_FPM_LQ
447
+ #if HAVE_FPM_LQ
448
448
"last request cpu: %.2f\n"
449
449
#endif
450
450
"last request memory : %zu \n ";
@@ -459,7 +459,7 @@ int fpm_status_handle_request(void) /* {{{ */
459
459
time_buffer ,
460
460
(unsigned long ) (now_epoch - scoreboard .start_epoch ),
461
461
scoreboard .requests ,
462
- #ifdef HAVE_FPM_LQ
462
+ #if HAVE_FPM_LQ
463
463
scoreboard .lq ,
464
464
scoreboard .lq_max ,
465
465
scoreboard .lq_len ,
@@ -486,7 +486,7 @@ int fpm_status_handle_request(void) /* {{{ */
486
486
zend_string * tmp_query_string ;
487
487
char * query_string ;
488
488
struct timeval duration , now ;
489
- #ifdef HAVE_FPM_LQ
489
+ #if HAVE_FPM_LQ
490
490
float cpu ;
491
491
#endif
492
492
@@ -522,7 +522,7 @@ int fpm_status_handle_request(void) /* {{{ */
522
522
}
523
523
}
524
524
525
- #ifdef HAVE_FPM_LQ
525
+ #if HAVE_FPM_LQ
526
526
/* prevent NaN */
527
527
if (proc .cpu_duration .tv_sec == 0 && proc .cpu_duration .tv_usec == 0 ) {
528
528
cpu = 0. ;
@@ -551,7 +551,7 @@ int fpm_status_handle_request(void) /* {{{ */
551
551
proc .content_length ,
552
552
proc .auth_user [0 ] != '\0' ? proc .auth_user : "-" ,
553
553
proc .script_filename [0 ] != '\0' ? proc .script_filename : "-" ,
554
- #ifdef HAVE_FPM_LQ
554
+ #if HAVE_FPM_LQ
555
555
proc .request_stage == FPM_REQUEST_ACCEPTING ? cpu : 0. ,
556
556
#endif
557
557
proc .request_stage == FPM_REQUEST_ACCEPTING ? proc .memory : 0 );
0 commit comments