forked from netdata/netdata
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RRD files split, renames, cleanup Part 2 (netdata#19405)
more splits, renames and cleanup - no functional changes
- Loading branch information
Showing
57 changed files
with
629 additions
and
564 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
#include "rrd-algorithm.h" | ||
|
||
RRD_ALGORITHM rrd_algorithm_id(const char *name) { | ||
if(strcmp(name, RRD_ALGORITHM_INCREMENTAL_NAME) == 0) | ||
return RRD_ALGORITHM_INCREMENTAL; | ||
|
||
else if(strcmp(name, RRD_ALGORITHM_ABSOLUTE_NAME) == 0) | ||
return RRD_ALGORITHM_ABSOLUTE; | ||
|
||
else if(strcmp(name, RRD_ALGORITHM_PCENT_OVER_ROW_TOTAL_NAME) == 0) | ||
return RRD_ALGORITHM_PCENT_OVER_ROW_TOTAL; | ||
|
||
else if(strcmp(name, RRD_ALGORITHM_PCENT_OVER_DIFF_TOTAL_NAME) == 0) | ||
return RRD_ALGORITHM_PCENT_OVER_DIFF_TOTAL; | ||
|
||
else | ||
return RRD_ALGORITHM_ABSOLUTE; | ||
} | ||
|
||
const char *rrd_algorithm_name(RRD_ALGORITHM algorithm) { | ||
switch(algorithm) { | ||
case RRD_ALGORITHM_ABSOLUTE: | ||
default: | ||
return RRD_ALGORITHM_ABSOLUTE_NAME; | ||
|
||
case RRD_ALGORITHM_INCREMENTAL: | ||
return RRD_ALGORITHM_INCREMENTAL_NAME; | ||
|
||
case RRD_ALGORITHM_PCENT_OVER_ROW_TOTAL: | ||
return RRD_ALGORITHM_PCENT_OVER_ROW_TOTAL_NAME; | ||
|
||
case RRD_ALGORITHM_PCENT_OVER_DIFF_TOTAL: | ||
return RRD_ALGORITHM_PCENT_OVER_DIFF_TOTAL_NAME; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
#ifndef NETDATA_RRD_ALGORITHM_H | ||
#define NETDATA_RRD_ALGORITHM_H | ||
|
||
#include "libnetdata/libnetdata.h" | ||
|
||
typedef enum __attribute__ ((__packed__)) rrd_algorithm { | ||
RRD_ALGORITHM_ABSOLUTE = 0, | ||
RRD_ALGORITHM_INCREMENTAL = 1, | ||
RRD_ALGORITHM_PCENT_OVER_DIFF_TOTAL = 2, | ||
RRD_ALGORITHM_PCENT_OVER_ROW_TOTAL = 3, | ||
|
||
// this is 8-bit | ||
} RRD_ALGORITHM; | ||
|
||
#define RRD_ALGORITHM_ABSOLUTE_NAME "absolute" | ||
#define RRD_ALGORITHM_INCREMENTAL_NAME "incremental" | ||
#define RRD_ALGORITHM_PCENT_OVER_DIFF_TOTAL_NAME "percentage-of-incremental-row" | ||
#define RRD_ALGORITHM_PCENT_OVER_ROW_TOTAL_NAME "percentage-of-absolute-row" | ||
|
||
RRD_ALGORITHM rrd_algorithm_id(const char *name); | ||
const char *rrd_algorithm_name(RRD_ALGORITHM algorithm); | ||
|
||
|
||
#endif //NETDATA_RRD_ALGORITHM_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
|
||
#include "rrd.h" | ||
|
||
inline const char *rrd_memory_mode_name(RRD_MEMORY_MODE id) { | ||
inline const char *rrd_memory_mode_name(RRD_DB_MODE id) { | ||
switch(id) { | ||
case RRD_MEMORY_MODE_RAM: | ||
return RRD_MEMORY_MODE_RAM_NAME; | ||
case RRD_DB_MODE_RAM: | ||
return RRD_DB_MODE_RAM_NAME; | ||
|
||
case RRD_MEMORY_MODE_NONE: | ||
return RRD_MEMORY_MODE_NONE_NAME; | ||
case RRD_DB_MODE_NONE: | ||
return RRD_DB_MODE_NONE_NAME; | ||
|
||
case RRD_MEMORY_MODE_ALLOC: | ||
return RRD_MEMORY_MODE_ALLOC_NAME; | ||
case RRD_DB_MODE_ALLOC: | ||
return RRD_DB_MODE_ALLOC_NAME; | ||
|
||
case RRD_MEMORY_MODE_DBENGINE: | ||
return RRD_MEMORY_MODE_DBENGINE_NAME; | ||
case RRD_DB_MODE_DBENGINE: | ||
return RRD_DB_MODE_DBENGINE_NAME; | ||
} | ||
|
||
STORAGE_ENGINE* eng = storage_engine_get(id); | ||
if (eng) { | ||
return eng->name; | ||
} | ||
|
||
return RRD_MEMORY_MODE_RAM_NAME; | ||
return RRD_DB_MODE_RAM_NAME; | ||
} | ||
|
||
RRD_MEMORY_MODE rrd_memory_mode_id(const char *name) { | ||
RRD_DB_MODE rrd_memory_mode_id(const char *name) { | ||
STORAGE_ENGINE* eng = storage_engine_find(name); | ||
if (eng) { | ||
return eng->id; | ||
} | ||
|
||
return RRD_MEMORY_MODE_RAM; | ||
return RRD_DB_MODE_RAM; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.