Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/cgi/sfs.cgi.in
Original file line number Diff line number Diff line change
Expand Up @@ -3235,6 +3235,7 @@ if "CC" in sectionset:
(21, 'create', 'number of chunk creations per minute'),
(22, 'delete', 'number of chunk deletions per minute'),
(27, 'tests', 'number of chunk tests per minute'),
(31, 'gcpurge', 'number of chunk purges(.dat and .met) by GC per minute'),
)
servers = []

Expand Down
12 changes: 7 additions & 5 deletions src/chunkserver/chartsdata.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@
#define CHARTS_CHUNKIOJOBS 28
#define CHARTS_CHUNKOPJOBS 29
#define CHARTS_MEMORY 30
#define CHARTS_GC_PURGE 31

#define CHARTS_NUMBER 31
#define CHARTS_NUMBER 32

const unsigned long kLinuxMaxrssSize = 1024UL;

Expand Down Expand Up @@ -113,6 +114,7 @@ const unsigned long kLinuxMaxrssSize = 1024UL;
{"chunkiojobs" ,CHARTS_MODE_MAX,0,CHARTS_SCALE_NONE , 1, 1}, \
{"chunkopjobs" ,CHARTS_MODE_MAX,0,CHARTS_SCALE_NONE , 1, 1}, \
{"memory" ,CHARTS_MODE_MAX,0,CHARTS_SCALE_NONE , 1, 1}, \
{"gcpurge" ,CHARTS_MODE_ADD,0,CHARTS_SCALE_NONE , 1, 1}, \
{NULL ,0 ,0,0 , 0, 0} \
};

Expand Down Expand Up @@ -165,7 +167,7 @@ void chartsdata_refresh(void) {
uint64_t bytesIn, bytesOut, totalBytesRead, totalBytesWrite;
uint32_t opsRead, opsWrite, totalOpsRead, totalOpsWrite, replications = 0;
uint32_t opsCreate, opsDelete, opsUpdateVersion, opsDuplicate, opsTruncate;
uint32_t opsDupTrunc, opsTest;
uint32_t opsDupTrunc, opsTest, opsGCPurge;
uint32_t maxChunkServerJobsCount, maxMasterJobsCount;

// Timer runs only when the process is executing.
Expand Down Expand Up @@ -245,16 +247,16 @@ void chartsdata_refresh(void) {
data[CHARTS_TOTAL_LLOPW] = totalOpsWrite;
data[CHARTS_REPL] = replications + gReplicator.getStats();

HddStats::operationStats(&opsCreate, &opsDelete, &opsUpdateVersion,
&opsDuplicate, &opsTruncate, &opsDupTrunc,
&opsTest);
HddStats::operationStats(&opsCreate, &opsDelete, &opsUpdateVersion, &opsDuplicate, &opsTruncate,
&opsDupTrunc, &opsTest, &opsGCPurge);
data[CHARTS_CREATE] = opsCreate;
data[CHARTS_DELETE] = opsDelete;
data[CHARTS_VERSION] = opsUpdateVersion;
data[CHARTS_DUPLICATE] = opsDuplicate;
data[CHARTS_TRUNCATE] = opsTruncate;
data[CHARTS_DUPTRUNC] = opsDupTrunc;
data[CHARTS_TEST] = opsTest;
data[CHARTS_GC_PURGE] = opsGCPurge;

charts_add(data, eventloop_time() - SECONDS_IN_ONE_MINUTE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "chunkserver-common/chunk_trash_manager_impl.h"
#include "config/cfg.h"
#include "errors/saunafs_error_codes.h"
#include "hdd_stats.h"
#include "slogger/slogger.h"

namespace fs = std::filesystem;
Expand Down Expand Up @@ -161,6 +162,7 @@ void ChunkTrashManagerImpl::removeTrashFiles(
for (const auto &[diskPath, fileEntries] : filesToRemove) {
for (const auto &fileEntry : fileEntries) {
if (removeFileFromTrash(fileEntry.second) != SAUNAFS_STATUS_OK) { continue; }
HddStats::gStatsOperationsGCPurge++;
getTrashIndex().remove(fileEntry.first, fileEntry.second, diskPath);
}
}
Expand Down
9 changes: 5 additions & 4 deletions src/chunkserver/chunkserver-common/hdd_stats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "common/platform.h"

#include "chunkserver-common/hdd_stats.h"
#include <cstdint>

#include "chunkserver-common/disk_interface.h"
#include "devtools/TracePrinter.h"
Expand Down Expand Up @@ -83,10 +84,9 @@ void stats(statsReport report) {
*report.totalWriteTime = gStatsTotalTimeWrite.exchange(0);
}

void operationStats(uint32_t *opsCreate, uint32_t *opsDelete,
uint32_t *opsUpdateVersion, uint32_t *opsDuplicate,
uint32_t *opsTruncate, uint32_t *opsDupTrunc,
uint32_t *opsTest) {
void operationStats(uint32_t *opsCreate, uint32_t *opsDelete, uint32_t *opsUpdateVersion,
uint32_t *opsDuplicate, uint32_t *opsTruncate, uint32_t *opsDupTrunc,
uint32_t *opsTest, uint32_t *opsGCPurge) {
TRACETHIS();
*opsCreate = gStatsOperationsCreate.exchange(0);
*opsDelete = gStatsOperationsDelete.exchange(0);
Expand All @@ -95,6 +95,7 @@ void operationStats(uint32_t *opsCreate, uint32_t *opsDelete,
*opsDuplicate = gStatsOperationsDuplicate.exchange(0);
*opsTruncate = gStatsOperationsTruncate.exchange(0);
*opsDupTrunc = gStatsOperationsDupTrunc.exchange(0);
*opsGCPurge = gStatsOperationsGCPurge.exchange(0);
}

void overheadRead(uint32_t size) {
Expand Down
4 changes: 3 additions & 1 deletion src/chunkserver/chunkserver-common/hdd_stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ inline std::atomic<uint32_t> gStatsOperationsDuplicate(0);
inline std::atomic<uint32_t> gStatsOperationsTruncate(0);
inline std::atomic<uint32_t> gStatsOperationsDupTrunc(0);

inline std::atomic<uint32_t> gStatsOperationsGCPurge(0);

struct statsReport {
statsReport(uint64_t *overBytesRead, uint64_t *overBytesWrite,
uint32_t *overOpsRead, uint32_t *overOpsWrite,
Expand Down Expand Up @@ -99,7 +101,7 @@ void stats(statsReport report);
void operationStats(uint32_t *opsCreate, uint32_t *opsDelete,
uint32_t *opsUpdateVersion, uint32_t *opsDuplicate,
uint32_t *opsTruncate, uint32_t *opsDupTrunc,
uint32_t *opsTest);
uint32_t *opsTest, uint32_t *opsGCPurge);

void overheadRead(uint32_t size);
void overheadWrite(uint32_t size);
Expand Down