]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/mgr/StoreIoAction.cc
2 * DEBUG: section 16 Cache Manager API
7 #include "base/TextException.h"
8 #include "ipc/Messages.h"
9 #include "ipc/TypedMsgHdr.h"
10 #include "mgr/StoreIoAction.h"
14 Mgr::StoreIoActionData::StoreIoActionData()
16 xmemset(this, 0, sizeof(*this));
19 Mgr::StoreIoActionData
&
20 Mgr::StoreIoActionData::operator += (const StoreIoActionData
& stats
)
22 create_calls
+= stats
.create_calls
;
23 create_select_fail
+= stats
.create_select_fail
;
24 create_create_fail
+= stats
.create_create_fail
;
25 create_success
+= stats
.create_success
;
30 Mgr::StoreIoAction::Pointer
31 Mgr::StoreIoAction::Create(const CommandPointer
&cmd
)
33 return new StoreIoAction(cmd
);
36 Mgr::StoreIoAction::StoreIoAction(const CommandPointer
&cmd
):
43 Mgr::StoreIoAction::add(const Action
& action
)
46 data
+= dynamic_cast<const StoreIoAction
&>(action
).data
;
50 Mgr::StoreIoAction::collect()
52 data
.create_calls
= store_io_stats
.create
.calls
;
53 data
.create_select_fail
= store_io_stats
.create
.select_fail
;
54 data
.create_create_fail
= store_io_stats
.create
.create_fail
;
55 data
.create_success
= store_io_stats
.create
.success
;
59 Mgr::StoreIoAction::dump(StoreEntry
* entry
)
63 storeAppendPrintf(entry
, "Store IO Interface Stats\n");
64 storeAppendPrintf(entry
, "create.calls %.0f\n", data
.create_calls
);
65 storeAppendPrintf(entry
, "create.select_fail %.0f\n", data
.create_select_fail
);
66 storeAppendPrintf(entry
, "create.create_fail %.0f\n", data
.create_create_fail
);
67 storeAppendPrintf(entry
, "create.success %.0f\n", data
.create_success
);
71 Mgr::StoreIoAction::pack(Ipc::TypedMsgHdr
& msg
) const
73 msg
.setType(Ipc::mtCacheMgrResponse
);
78 Mgr::StoreIoAction::unpack(const Ipc::TypedMsgHdr
& msg
)
80 msg
.checkType(Ipc::mtCacheMgrResponse
);