Skip to content

Commit

Permalink
libpressio version 0.66.0
Browse files Browse the repository at this point in the history
Major Changes/Bug Fixs

+ size metrics module now return uint64_t instead of int32_t.
+ composite_metrics now forwards documentation requests
+ standardized on bytes for memory metrics
  • Loading branch information
robertu94 committed May 25, 2021
1 parent 0a067d7 commit df7fc89
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
project(libpressio VERSION "0.65.0" LANGUAGES CXX C)
project(libpressio VERSION "0.66.0" LANGUAGES CXX C)

#correct was to set a default build type
# https://blog.kitware.com/cmake-and-the-default-build-type/
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/metrics/composite.cc
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,12 @@ class composite_plugin : public libpressio_metrics_plugin {

pressio_options get_documentation_impl() const override {
pressio_options options;
set_meta_many_docs(options, "composite:plugins", "plugins used for gathering metrics", plugins);
set(options, "composite:compression_rate", "compression rate for the compress method, activated by size and time");
set(options, "composite:compression_rate_many", "compression rate for the compress_many method, activated by size and time");
set(options, "composite:decompression_rate", "decompression rate for the compress method, activated by size and time");
set(options, "composite:decompression_rate_many", "decompression rate for the compress_many method, activated by size and time");
set(options, "composite:names", "the names to use for the constructed metrics plugins");
set(options, "composite:plugins", "the ids to use for the constructed metrics plugins");
set(options, "composite:scripts", "a lua script used to compute metrics from other metrics that have been previously computed");
set(options, "pressio:description", "meta-metric that runs a set of metrics in sequence");

Expand Down
18 changes: 9 additions & 9 deletions src/plugins/metrics/rusage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace memory_metrics{
struct memory_range{
uint64_t begin = 0;
uint64_t end = 0;
uint64_t used() const { return end-begin; }
uint64_t used() const { return (end-begin) * 1024; }
};
using tracker = compat::optional<memory_range>;
uint64_t now() {
Expand Down Expand Up @@ -150,14 +150,14 @@ class memory_plugin : public libpressio_metrics_plugin {
struct pressio_options get_documentation_impl() const override {
pressio_options opts;

set(opts, "pressio:description", "uses rusage to record memory usage");
set(opts, "memory:check_options", "memory used by check options");
set(opts, "memory:set_options", "memory used by set options");
set(opts, "memory:get_options", "memory used by get options");
set(opts, "memory:compress", "memory used by compress");
set(opts, "memory:decompress", "memory used by decompress");
set(opts, "memory:compress_many", "memory used by compress_many");
set(opts, "memory:decompress_many", "memory used by decompress_many");
set(opts, "pressio:description", "uses getrusage to record memory usage");
set(opts, "memory:check_options", "memory used in bytes by check options");
set(opts, "memory:set_options", "memory used in bytes by set options");
set(opts, "memory:get_options", "memory used in bytes by get options");
set(opts, "memory:compress", "memory used in bytes by compress");
set(opts, "memory:decompress", "memory used in bytes by decompress");
set(opts, "memory:compress_many", "memory used in bytes by compress_many");
set(opts, "memory:decompress_many", "memory used in bytes by decompress_many");

return opts;
}
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/metrics/size.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ class size_plugin : public libpressio_metrics_plugin {

auto set_or_size_t = [&opt, this](const char* key, compat::optional<size_t> size) {
if(size) {
set(opt, key, static_cast<unsigned int>(*size));
set(opt, key, static_cast<uint64_t>(*size));
} else {
set_type(opt, key, pressio_option_uint32_type);
set_type(opt, key, pressio_option_uint64_type);
}
};

Expand Down

0 comments on commit df7fc89

Please sign in to comment.