]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/mgr/IoAction.cc
4 * DEBUG: section 16 Cache Manager API
9 #include "base/TextException.h"
10 #include "ipc/Messages.h"
11 #include "ipc/TypedMsgHdr.h"
12 #include "mgr/IoAction.h"
13 #include "SquidMath.h"
17 extern void GetIoStats(Mgr::IoActionData
& stats
);
18 extern void DumpIoStats(Mgr::IoActionData
& stats
, StoreEntry
* sentry
);
20 Mgr::IoActionData::IoActionData()
22 xmemset(this, 0, sizeof(*this));
26 Mgr::IoActionData::operator += (const IoActionData
& stats
)
28 http_reads
+= stats
.http_reads
;
29 for (int i
= 0; i
< _iostats::histSize
; ++i
)
30 http_read_hist
[i
] += stats
.http_read_hist
[i
];
31 ftp_reads
+= stats
.ftp_reads
;
32 for (int i
= 0; i
< _iostats::histSize
; ++i
)
33 ftp_read_hist
[i
] += stats
.ftp_read_hist
[i
];
34 gopher_reads
+= stats
.gopher_reads
;
35 for (int i
= 0; i
< _iostats::histSize
; ++i
)
36 gopher_read_hist
[i
] += stats
.gopher_read_hist
[i
];
41 Mgr::IoAction::Pointer
42 Mgr::IoAction::Create(const CommandPointer
&cmd
)
44 return new IoAction(cmd
);
47 Mgr::IoAction::IoAction(const CommandPointer
&cmd
):
54 Mgr::IoAction::add(const Action
& action
)
57 data
+= dynamic_cast<const IoAction
&>(action
).data
;
61 Mgr::IoAction::collect()
67 Mgr::IoAction::dump(StoreEntry
* entry
)
71 DumpIoStats(data
, entry
);
75 Mgr::IoAction::pack(Ipc::TypedMsgHdr
& msg
) const
77 msg
.setType(Ipc::mtCacheMgrResponse
);
82 Mgr::IoAction::unpack(const Ipc::TypedMsgHdr
& msg
)
84 msg
.checkType(Ipc::mtCacheMgrResponse
);