Summary
Replace the 4-tier time-series statistics (~16 KB RAM, ~1,000 LOC across httpstat.c and httprepo.c) with:
- SMF Type 243 records per HTTP request via crent370's
smf_init() + smf_write() API
- Simple in-memory counters in the HTTPD struct for operator display (
/F HTTPD,STATS)
Current State (to be removed)
| File |
LOC |
Description |
httpstat.c |
509 |
4-tier time-series (month/day/hour/min), HTTPSTAT records, dataset load/save |
httprepo.c |
419 |
Apache Combined Log Format formatter + httpstat_add() |
HTTPD struct fields to remove: st_month, st_day, st_hour, st_min, st_dataset, cfg_st_*_max, FILE *stats
New Design
SMF Type 243 Record (httpsmf.c, ~50 LOC)
#define SMF_TYPE_HTTPD 243
#define SMF_HTTPD_REQUEST 1
struct smf_httpd_request {
SMF_HEADER hdr; /* 18 Bytes Standard SMF Header */
char ssi[4]; /* "HTTP" */
short subtype; /* 1 = Request completed */
char userid[8]; /* RACF User (blank if none) */
unsigned int client_addr; /* Client IPv4 */
short resp_code; /* HTTP Status Code */
unsigned int bytes_sent; /* Response Bytes */
unsigned int duration_us; /* Request duration microseconds*/
char method[8]; /* GET/POST/PUT/DELETE */
char uri[64]; /* Request URI (truncated) */
};
In-Memory Counters
unsigned total_requests;
unsigned total_errors;
unsigned total_bytes_sent;
unsigned active_connections;
/F HTTPD,STATS displays these via WTO — no dataset I/O.
Implementation Steps
- Delete
httpstat.c — remove HTTPSTAT arrays/fields from HTTPD struct, remove httpstat_load()/httpstat_save() calls, replace httpstat_report() with counter display, remove stats parmlib keywords
- Delete
httprepo.c, create httpsmf.c — SMF record + counter increment + state transition
- Add counters to HTTPD struct — replace old
st_* fields
No access log in 4.0.0 — can be added as optional feature later.
Dependencies
- crent370 SMF API (
smf_init() + smf_write()) must be implemented first
- SMF must be activated in SYS1.PARMLIB(SMFPRMxx):
SYS(TYPE(243))
Acceptance Criteria
Summary
Replace the 4-tier time-series statistics (~16 KB RAM, ~1,000 LOC across
httpstat.candhttprepo.c) with:smf_init()+smf_write()API/F HTTPD,STATS)Current State (to be removed)
httpstat.chttprepo.cHTTPD struct fields to remove:
st_month,st_day,st_hour,st_min,st_dataset,cfg_st_*_max,FILE *statsNew Design
SMF Type 243 Record (
httpsmf.c, ~50 LOC)In-Memory Counters
/F HTTPD,STATSdisplays these via WTO — no dataset I/O.Implementation Steps
httpstat.c— remove HTTPSTAT arrays/fields from HTTPD struct, removehttpstat_load()/httpstat_save()calls, replacehttpstat_report()with counter display, remove stats parmlib keywordshttprepo.c, createhttpsmf.c— SMF record + counter increment + state transitionst_*fieldsNo access log in 4.0.0 — can be added as optional feature later.
Dependencies
smf_init()+smf_write()) must be implemented firstSYS(TYPE(243))Acceptance Criteria
httpstat.cdeletedhttprepo.cdeleted, replaced byhttpsmf.cFILE *statsremoved)/F HTTPD,STATSshows simple counters (requests, errors, bytes, connections)