IntervalAction.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
3  *
4  * Squid software is distributed under GPLv2+ license and includes
5  * contributions from numerous individuals and organizations.
6  * Please see the COPYING and CONTRIBUTORS files for details.
7  */
8 
9 /* DEBUG: section 16 Cache Manager API */
10 
11 #ifndef SQUID_SRC_MGR_INTERVALACTION_H
12 #define SQUID_SRC_MGR_INTERVALACTION_H
13 
14 #include "mgr/Action.h"
15 
16 namespace Mgr
17 {
18 
22 {
23 public:
26 
27 public:
28  struct timeval sample_start_time;
29  struct timeval sample_end_time;
56  double icp_pkts_sent;
57  double icp_pkts_recv;
74  double page_faults;
75  double select_loops;
76  double select_fds;
79  double swap_outs;
80  double swap_ins;
104  double cpu_time;
105  double wall_time;
106  unsigned int count;
107 };
108 
110 class IntervalAction: public Action
111 {
112 protected:
113  IntervalAction(const CommandPointer &cmd, int aMinutes, int aHours);
114 
115 public:
116  static Pointer Create5min(const CommandPointer &cmd);
117  static Pointer Create60min(const CommandPointer &cmd);
118  /* Action API */
119  void add(const Action& action) override;
120  void pack(Ipc::TypedMsgHdr& msg) const override;
121  void unpack(const Ipc::TypedMsgHdr& msg) override;
122 
123 protected:
124  /* Action API */
125  void collect() override;
126  void dump(StoreEntry* entry) override;
127 
128 private:
129  int minutes;
130  int hours;
132 };
133 
134 } // namespace Mgr
135 
136 #endif /* SQUID_SRC_MGR_INTERVALACTION_H */
137 
IntervalActionData data
void dump(StoreEntry *entry) override
const CommandPointer cmd
the command that caused this action
Definition: Action.h:90
double client_http_all_median_svc_time
IntervalActionData & operator+=(const IntervalActionData &stats)
struct timeval sample_start_time
struct timeval sample_end_time
void pack(Ipc::TypedMsgHdr &msg) const override
pack collected action info into a message to be sent to Coordinator
static Pointer Create5min(const CommandPointer &cmd)
double client_http_miss_median_svc_time
void unpack(const Ipc::TypedMsgHdr &msg) override
unpack action info from the message received by Coordinator
double hitValidationRefusalsDueToTimeLimit
double hitValidationRefusalsDueToZeroSize
double client_http_hit_median_svc_time
IntervalAction(const CommandPointer &cmd, int aMinutes, int aHours)
struct msghdr with a known type, fixed-size I/O and control buffers
Definition: TypedMsgHdr.h:34
void collect() override
calculate and keep local action-specific information
implement aggregated interval actions
double hitValidationRefusalsDueToLocking
static Pointer Create60min(const CommandPointer &cmd)
void add(const Action &action) override
incrementally merge in remote information (of the same action type)
Cache Manager API.
Definition: Action.h:20

 

Introduction

Documentation

Support

Miscellaneous