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
11 changes: 8 additions & 3 deletions include/proxy-wasm/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,17 @@ class ContextBase : public RootInterface,
WasmResult log(uint32_t /* level */, std::string_view /* message */) override {
return unimplemented();
}
uint32_t getLogLevel() override { return static_cast<uint32_t>(LogLevel::info); }
uint32_t getLogLevel() override {
unimplemented();
return 0;
}
uint64_t getCurrentTimeNanoseconds() override {
return std::chrono::system_clock::now().time_since_epoch().count();
unimplemented();
return 0;
}
uint64_t getMonotonicTimeNanoseconds() override {
return std::chrono::steady_clock::now().time_since_epoch().count();
unimplemented();
return 0;
}
std::string_view getConfiguration() override {
unimplemented();
Expand Down
11 changes: 11 additions & 0 deletions test/utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,17 @@ class TestContext : public ContextBase {

bool isLogged(std::string_view message) { return log_.find(message) != std::string::npos; }

uint64_t getCurrentTimeNanoseconds() override {
return std::chrono::duration_cast<std::chrono::nanoseconds>(
std::chrono::system_clock::now().time_since_epoch())
.count();
}
uint64_t getMonotonicTimeNanoseconds() override {
return std::chrono::duration_cast<std::chrono::nanoseconds>(
std::chrono::steady_clock::now().time_since_epoch())
.count();
}

private:
std::string log_;
};
Expand Down