StoreIoAction.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"
15#include "mgr/StoreIoAction.h"
16#include "Store.h"
17#include "tools.h"
18
20{
21 memset(this, 0, sizeof(*this));
22}
23
26{
27 create_calls += stats.create_calls;
28 create_select_fail += stats.create_select_fail;
29 create_create_fail += stats.create_create_fail;
30 create_success += stats.create_success;
31
32 return *this;
33}
34
37{
38 return new StoreIoAction(cmd);
39}
40
42 Action(aCmd), data()
43{
44 debugs(16, 5, MYNAME);
45}
46
47void
49{
50 debugs(16, 5, MYNAME);
51 data += dynamic_cast<const StoreIoAction&>(action).data;
52}
53
54void
56{
57 data.create_calls = store_io_stats.create.calls;
58 data.create_select_fail = store_io_stats.create.select_fail;
59 data.create_create_fail = store_io_stats.create.create_fail;
60 data.create_success = store_io_stats.create.success;
61}
62
63void
65{
66 debugs(16, 5, MYNAME);
67 Must(entry != nullptr);
68 storeAppendPrintf(entry, "Store IO Interface Stats\n");
69 storeAppendPrintf(entry, "create.calls %.0f\n", data.create_calls);
70 storeAppendPrintf(entry, "create.select_fail %.0f\n", data.create_select_fail);
71 storeAppendPrintf(entry, "create.create_fail %.0f\n", data.create_create_fail);
72 storeAppendPrintf(entry, "create.success %.0f\n", data.create_success);
73}
74
75void
77{
79 msg.putPod(data);
80}
81
82void
84{
86 msg.getPod(data);
87}
88
StoreIoStats store_io_stats
Definition: store_io.cc:16
#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 IO interface data.
Definition: StoreIoAction.h:21
StoreIoActionData & operator+=(const StoreIoActionData &stats)
implement aggregated 'store_io' action
Definition: StoreIoAction.h:35
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 add(const Action &action) override
incrementally merge in remote information (of the same action type)
void unpack(const Ipc::TypedMsgHdr &msg) override
unpack action info from the message received by Coordinator
static Pointer Create(const CommandPointer &cmd)
StoreIoAction(const CommandPointer &cmd)
void dump(StoreEntry *entry) override
int select_fail
Definition: StoreStats.h:64
struct StoreIoStats::@144 create
cache_dir selection and disk entry creation stats
int create_fail
Definition: StoreStats.h:65
#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
void storeAppendPrintf(StoreEntry *e, const char *fmt,...)
Definition: store.cc:841

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors