ServiceTimesAction.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2017 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 #include "squid.h"
12 #include "base/TextException.h"
13 #include "ipc/Messages.h"
14 #include "ipc/TypedMsgHdr.h"
15 #include "mgr/ServiceTimesAction.h"
16 #include "Store.h"
17 #include "tools.h"
18 
21 
23 {
24  memset(this, 0, sizeof(*this));
25 }
26 
29 {
30  for (int i = 0; i < seriesSize; ++i) {
31  http_requests5[i] += stats.http_requests5[i];
32  http_requests60[i] += stats.http_requests60[i];
33 
34  cache_misses5[i] += stats.cache_misses5[i];
35  cache_misses60[i] += stats.cache_misses60[i];
36 
37  cache_hits5[i] += stats.cache_hits5[i];
38  cache_hits60[i] += stats.cache_hits60[i];
39 
40  near_hits5[i] += stats.near_hits5[i];
41  near_hits60[i] += stats.near_hits60[i];
42 
43  not_modified_replies5[i] += stats.not_modified_replies5[i];
44  not_modified_replies60[i] += stats.not_modified_replies60[i];
45 
46  dns_lookups5[i] += stats.dns_lookups5[i];
47  dns_lookups60[i] += stats.dns_lookups60[i];
48 
49  icp_queries5[i] += stats.icp_queries5[i];
50  icp_queries60[i] += stats.icp_queries60[i];
51  }
52  ++count;
53 
54  return *this;
55 }
56 
59 {
60  return new ServiceTimesAction(cmd);
61 }
62 
64  Action(aCmd), data()
65 {
66  debugs(16, 5, HERE);
67 }
68 
69 void
71 {
72  debugs(16, 5, HERE);
73  data += dynamic_cast<const ServiceTimesAction&>(action).data;
74 }
75 
76 void
78 {
79  debugs(16, 5, HERE);
81 }
82 
83 void
85 {
86  debugs(16, 5, HERE);
87  Must(entry != NULL);
89 }
90 
91 void
93 {
95  msg.putPod(data);
96 }
97 
98 void
100 {
102  msg.getPod(data);
103 }
104 
virtual void pack(Ipc::TypedMsgHdr &msg) const
pack collected action info into a message to be sent to Coordinator
void getPod(Pod &pod) const
load POD
Definition: TypedMsgHdr.h:50
double http_requests5[seriesSize]
int i
Definition: membanger.c:49
implement aggregated 'service_times' action
double icp_queries5[seriesSize]
void putPod(const Pod &pod)
store POD
Definition: TypedMsgHdr.h:52
class Ping::pingStats_ stats
double icp_queries60[seriesSize]
double dns_lookups60[seriesSize]
double not_modified_replies60[seriesSize]
double not_modified_replies5[seriesSize]
void GetServiceTimesStats(Mgr::ServiceTimesActionData &stats)
Definition: stat.cc:807
void const char HLPCB void * data
Definition: stub_helper.cc:16
ServiceTimesAction(const CommandPointer &cmd)
#define debugs(SECTION, LEVEL, CONTENT)
Definition: Debug.h:123
ServiceTimesActionData & operator+=(const ServiceTimesActionData &stats)
double cache_misses60[seriesSize]
void DumpServiceTimesStats(Mgr::ServiceTimesActionData &stats, StoreEntry *sentry)
Definition: stat.cc:835
double http_requests60[seriesSize]
virtual void add(const Action &action)
incrementally merge in remote information (of the same action type)
static Pointer Create(const CommandPointer &cmd)
double dns_lookups5[seriesSize]
virtual void dump(StoreEntry *entry)
std::ostream & HERE(std::ostream &s)
Definition: Debug.h:147
store service times for 5 and 60 min
double near_hits60[seriesSize]
bool action(int fd, size_t metasize, const char *fn, const char *url, const SquidMetaList &meta)
Definition: purge.cc:311
#define Must(cond)
Definition: TextException.h:89
double cache_hits5[seriesSize]
virtual void unpack(const Ipc::TypedMsgHdr &msg)
unpack action info from the message received by Coordinator
struct msghdr with a known type, fixed-size I/O and control buffers
Definition: TypedMsgHdr.h:31
void checkType(int aType) const
throws if stored type is not aType
Definition: TypedMsgHdr.cc:84
double cache_misses5[seriesSize]
virtual void collect()
calculate and keep local action-specific information
void setType(int aType)
sets message type; use MessageType enum
Definition: TypedMsgHdr.cc:90
double cache_hits60[seriesSize]
#define NULL
Definition: types.h:166

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors