forked from sxs-collaboration/spectre
-
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.
Merge pull request sxs-collaboration#6463 from nilsvu/fix_status
Status CLI / dashboard: handle pending jobs better, plot simulation time over calendar time
- Loading branch information
Showing
7 changed files
with
111 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Distributed under the MIT License. | ||
// See LICENSE.txt for details. | ||
|
||
#include "Utilities/UtcTime.hpp" | ||
|
||
#include <sstream> | ||
|
||
#include <boost/date_time/posix_time/posix_time.hpp> | ||
#include <boost/date_time/posix_time/posix_time_io.hpp> | ||
|
||
std::string utc_time() { | ||
static const std::string datetime_format = "%Y-%m-%d %H:%M:%S UTC"; | ||
// Use this needlessly complicated implementation with Boost because the | ||
// needed features from C++20 aren't available yet in all compilers. | ||
const auto now_utc = boost::posix_time::second_clock::universal_time(); | ||
auto* time_facet = new boost::posix_time::time_facet(datetime_format.c_str()); | ||
std::ostringstream oss; | ||
oss.imbue(std::locale(std::locale::classic(), time_facet)); | ||
oss << now_utc; | ||
return oss.str(); | ||
} |
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,13 @@ | ||
// Distributed under the MIT License. | ||
// See LICENSE.txt for details. | ||
|
||
#pragma once | ||
|
||
#include <string> | ||
|
||
/*! | ||
* \brief Get the current date and time in UTC. | ||
* | ||
* The date and time are formatted as "YYYY-MM-DD HH:MM:SS UTC". | ||
*/ | ||
std::string utc_time(); |
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