Skip to content

Print metrics of application running time #2908

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 16, 2023
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
19 changes: 13 additions & 6 deletions analytical_engine/core/app/app_invoker.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@
#ifndef ANALYTICAL_ENGINE_CORE_APP_APP_INVOKER_H_
#define ANALYTICAL_ENGINE_CORE_APP_APP_INVOKER_H_

#include <glog/logging.h>

#include <cstdint>
#include <memory>
#include <string>
#include <type_traits>

#include "glog/logging.h"
#include "grape/util.h"

#ifdef NETWORKX
#include "core/object/dynamic.h"
#endif
Expand Down Expand Up @@ -186,15 +187,18 @@ class AppInvoker {
static void query_impl(std::shared_ptr<worker_t> worker,
const rpc::QueryArgs& query_args,
std::index_sequence<I...>) {
double start_time = grape::GetCurrentTime();
worker->Query(
ArgsUnpacker<typename std::remove_const<typename std::remove_reference<
typename ArgTypeAt<I + 1, context_init_func_t>::type>::type>::
type>::unpack(query_args.args(I))...);
double end_time = grape::GetCurrentTime();
LOG(INFO) << "Query time: " << end_time - start_time << " seconds";
}

public:
static bl::result<nullptr_t> Query(std::shared_ptr<worker_t> worker,
const rpc::QueryArgs& query_args) {
static bl::result<std::nullptr_t> Query(std::shared_ptr<worker_t> worker,
const rpc::QueryArgs& query_args) {
constexpr std::size_t args_num = ArgsNum<context_init_func_t>::value - 1;
// There maybe default argument
CHECK_OR_RAISE(args_num >= query_args.args_size());
Expand All @@ -212,15 +216,18 @@ class FlashAppInvoker {
static void query_impl(std::shared_ptr<worker_t> worker,
const rpc::QueryArgs& query_args,
std::index_sequence<I...>) {
double start_time = grape::GetCurrentTime();
worker->Query(
ArgsUnpacker<typename std::remove_const<typename std::remove_reference<
typename ArgTypeAt<I + 2, app_run_func_t>::type>::type>::type>::
unpack(query_args.args(I))...);
double end_time = grape::GetCurrentTime();
LOG(INFO) << "Query time: " << end_time - start_time << " seconds";
}

public:
static bl::result<nullptr_t> Query(std::shared_ptr<worker_t> worker,
const rpc::QueryArgs& query_args) {
static bl::result<std::nullptr_t> Query(std::shared_ptr<worker_t> worker,
const rpc::QueryArgs& query_args) {
constexpr std::size_t args_num = ArgsNum<app_run_func_t>::value - 2;
// There maybe default argument
CHECK_OR_RAISE(args_num >= query_args.args_size());
Expand Down
2 changes: 1 addition & 1 deletion coordinator/gscoordinator/cluster_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def get_interactive_executor_container(self, volume_mounts):
args = [
"bash",
"-c",
self._get_tail_if_exists_cmd("/var/log/graphscope/current/executor.log"),
self._get_tail_if_exists_cmd("/var/log/graphscope/current/executor.*.log"),
]
container = self.get_engine_container_helper(
name,
Expand Down