ServiceTimesAction.cc
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#include "squid.h"
12#include "base/TextException.h"
13#include "ipc/Messages.h"
14#include "ipc/TypedMsgHdr.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, MYNAME);
67}
68
69void
71{
72 debugs(16, 5, MYNAME);
73 data += dynamic_cast<const ServiceTimesAction&>(action).data;
74}
75
76void
78{
79 debugs(16, 5, MYNAME);
81}
82
83void
85{
86 debugs(16, 5, MYNAME);
87 Must(entry != nullptr);
88 DumpServiceTimesStats(data, entry);
89}
90
91void
93{
95 msg.putPod(data);
96}
97
98void
100{
102 msg.getPod(data);
103}
104
void GetServiceTimesStats(Mgr::ServiceTimesActionData &stats)
Definition: stat.cc:778
void DumpServiceTimesStats(Mgr::ServiceTimesActionData &stats, StoreEntry *sentry)
Definition: stat.cc:806
#define Must(condition)
Definition: TextException.h:75
struct msghdr with a known type, fixed-size I/O and control buffers
Definition: TypedMsgHdr.h:35
void getPod(Pod &pod) const
load POD
Definition: TypedMsgHdr.h:118
void checkType(int aType) const
Definition: TypedMsgHdr.cc:94
void putPod(const Pod &pod)
store POD
Definition: TypedMsgHdr.h:126
void setType(int aType)
sets message type; use MessageType enum
Definition: TypedMsgHdr.cc:100
store service times for 5 and 60 min
ServiceTimesActionData & operator+=(const ServiceTimesActionData &stats)
implement aggregated 'service_times' action
ServiceTimesAction(const CommandPointer &cmd)
void pack(Ipc::TypedMsgHdr &msg) const override
pack collected action info into a message to be sent to Coordinator
void collect() override
calculate and keep local action-specific information
void unpack(const Ipc::TypedMsgHdr &msg) override
unpack action info from the message received by Coordinator
void add(const Action &action) override
incrementally merge in remote information (of the same action type)
static Pointer Create(const CommandPointer &cmd)
void dump(StoreEntry *entry) override
#define MYNAME
Definition: Stream.h:236
#define debugs(SECTION, LEVEL, CONTENT)
Definition: Stream.h:194
@ mtCacheMgrResponse
Definition: Messages.h:36
class Ping::pingStats_ stats
static bool action(int fd, size_t metasize, const char *fn, const char *url, const SquidMetaList &meta)
Definition: purge.cc:315

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors