z_stats (zotonic_core v1.0.0-rc.10)
Link to this section Summary
Functions
Setup stats for each site.
Initialize the statistics collection machinery.
Collect log data from cowmachine and update cowmachine metrics
Count some amount, like data transfers
Record a duration
Count a event
Start the log buffer consumer.
Link to this section Functions
Link to this function
handle_call(Cmd, From, State)
Link to this function
handle_cast(Cmd, State)
Link to this function
handle_info(_, State)
Link to this function
init(Buffers)
Link to this function
init_site(Site)
Link to this function
init_system()
Link to this function
log_access(MetricsData)
Collect log data from cowmachine and update cowmachine metrics
The log entry from zotonic_listen_http_metrics is: Log = #{
site => Site,
reason => Reason,
req_start => ReqStart,
duration_total_usec => DurationTotalUsec,
duration_process_usec => DurationProcessUsec,
resp_status => RespStatus,
resp_status_category => StatusCategory,
req_bytes => ReqBodyLength,
resp_bytes => RespBodyLength,
http_version => cowboy_req:version(Req),
method => cowboy_req:method(Req),
path => cowboy_req:path(Req),
user_agent => cowboy_req:header(<<"user-agent">>, Req),
referer => cowboy_req:header(<<"referer">>, Req),
metrics => UserData#{ peer_ip => PeerIP }
}
Link to this function
record_count(System, What, Count, Context)
Link to this function
record_duration(System, What, Duration, Context)
Link to this function
record_event(System, What, Context)
Link to this function
start_link(Buffers)
Link to this function