]> git.ipfire.org Git - thirdparty/squid.git/blob - src/DiskIO/DiskDaemon/DiskdAction.h
Source Format Enforcement (#763)
[thirdparty/squid.git] / src / DiskIO / DiskDaemon / DiskdAction.h
1 /*
2 * Copyright (C) 1996-2021 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 79 Squid-side DISKD I/O functions. */
10
11 #ifndef SQUID_DISKD_ACTION_H
12 #define SQUID_DISKD_ACTION_H
13
14 #include "ipc/forward.h"
15 #include "mgr/Action.h"
16 #include "mgr/forward.h"
17
18 /// store disk daemon stats
19 class DiskdActionData
20 {
21 public:
22 DiskdActionData();
23 DiskdActionData& operator += (const DiskdActionData& stats);
24
25 public:
26 double sent_count;
27 double recv_count;
28 double max_away;
29 double max_shmuse;
30 double open_fail_queue_len;
31 double block_queue_len;
32 double open_ops;
33 double open_success;
34 double open_fail;
35 double create_ops;
36 double create_success;
37 double create_fail;
38 double close_ops;
39 double close_success;
40 double close_fail;
41 double unlink_ops;
42 double unlink_success;
43 double unlink_fail;
44 double read_ops;
45 double read_success;
46 double read_fail;
47 double write_ops;
48 double write_success;
49 double write_fail;
50 };
51
52 /// implement aggregated 'diskd' action
53 class DiskdAction: public Mgr::Action
54 {
55 protected:
56 DiskdAction(const Mgr::CommandPointer &aCmd);
57
58 public:
59 static Pointer Create(const Mgr::CommandPointer &aCmd);
60 /* Action API */
61 virtual void add(const Mgr::Action& action);
62 virtual void pack(Ipc::TypedMsgHdr& hdrMsg) const;
63 virtual void unpack(const Ipc::TypedMsgHdr& hdrMsg);
64
65 protected:
66 /* Action API */
67 virtual void collect();
68 virtual void dump(StoreEntry* entry);
69
70 private:
71 DiskdActionData data;
72 };
73
74 #endif /* SQUID_DISKD_ACTION_H */
75