-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
message-queue/cpp/src: wip postgres metrics
refs #6
- Loading branch information
1 parent
bf6d051
commit 9694508
Showing
5 changed files
with
35 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#include "postgres.hpp" | ||
|
||
Postgres::Postgres(Config &c) | ||
: conn(connection("postgres://mq@localhost/mq")) { | ||
} |
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,24 @@ | ||
#ifndef POSTGRES_CPP | ||
#define POSTGRES_CPP | ||
|
||
#include <optional> | ||
|
||
#include <pqxx/pqxx> | ||
|
||
#include "config.hpp" | ||
#include "runtime.hpp" | ||
#include "primitives.hpp" | ||
|
||
using namespace std; | ||
using namespace pqxx; | ||
|
||
class Postgres { | ||
connection conn; | ||
optional<int> runtime_id = nullopt; | ||
|
||
public: | ||
Postgres(Config&); | ||
void Push(Runtime&, SampleDesc&, Results&); | ||
}; | ||
|
||
#endif |
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 |
---|---|---|
|
@@ -45,4 +45,5 @@ class Runtime { | |
return ss.str(); | ||
} | ||
}; | ||
|
||
#endif |