]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/mgr/IoAction.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/IoAction.h"
11 #include "SquidMath.h"
15 extern void GetIoStats(Mgr::IoActionData
& stats
);
16 extern void DumpIoStats(Mgr::IoActionData
& stats
, StoreEntry
* sentry
);
18 Mgr::IoActionData::IoActionData()
20 xmemset(this, 0, sizeof(*this));
24 Mgr::IoActionData::operator += (const IoActionData
& stats
)
26 http_reads
+= stats
.http_reads
;
27 for (int i
= 0; i
< _iostats::histSize
; ++i
)
28 http_read_hist
[i
] += stats
.http_read_hist
[i
];
29 ftp_reads
+= stats
.ftp_reads
;
30 for (int i
= 0; i
< _iostats::histSize
; ++i
)
31 ftp_read_hist
[i
] += stats
.ftp_read_hist
[i
];
32 gopher_reads
+= stats
.gopher_reads
;
33 for (int i
= 0; i
< _iostats::histSize
; ++i
)
34 gopher_read_hist
[i
] += stats
.gopher_read_hist
[i
];
39 Mgr::IoAction::Pointer
40 Mgr::IoAction::Create(const CommandPointer
&cmd
)
42 return new IoAction(cmd
);
45 Mgr::IoAction::IoAction(const CommandPointer
&cmd
):
52 Mgr::IoAction::add(const Action
& action
)
55 data
+= dynamic_cast<const IoAction
&>(action
).data
;
59 Mgr::IoAction::collect()
65 Mgr::IoAction::dump(StoreEntry
* entry
)
69 DumpIoStats(data
, entry
);
73 Mgr::IoAction::pack(Ipc::TypedMsgHdr
& msg
) const
75 msg
.setType(Ipc::mtCacheMgrResponse
);
80 Mgr::IoAction::unpack(const Ipc::TypedMsgHdr
& msg
)
82 msg
.checkType(Ipc::mtCacheMgrResponse
);