1 /*
2 Copyright 2013-2015 Skytechnology sp. z o.o.
3
4 This file is part of LizardFS.
5
6 LizardFS is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, version 3.
9
10 LizardFS is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with LizardFS. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 #include "common/platform.h"
20 #include "chunkserver/network_stats.h"
21
22 std::atomic<uint64_t> stats_bytesin(0);
23 std::atomic<uint64_t> stats_bytesout(0);
24 std::atomic<uint32_t> stats_hlopr(0);
25 std::atomic<uint32_t> stats_hlopw(0);
26 std::atomic<uint32_t> stats_maxjobscnt(0);
27
networkStats(uint64_t * bin,uint64_t * bout,uint32_t * hlopr,uint32_t * hlopw,uint32_t * maxjobscnt)28 void networkStats(uint64_t *bin, uint64_t *bout, uint32_t *hlopr,
29 uint32_t *hlopw, uint32_t *maxjobscnt) {
30 *bin = stats_bytesin.exchange(0);
31 *bout = stats_bytesout.exchange(0);
32 *hlopr = stats_hlopr.exchange(0);
33 *hlopw = stats_hlopw.exchange(0);
34 *maxjobscnt = stats_maxjobscnt.exchange(0);
35 }
36