Skip to content

Commit

Permalink
separate
Browse files Browse the repository at this point in the history
  • Loading branch information
acelyc111 committed May 17, 2024
1 parent d331091 commit c9c9253
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 0 deletions.
47 changes: 47 additions & 0 deletions src/server/collector/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

set(MY_PROJ_NAME "pegasus_collector")

set(MY_PROJ_SRC
"${CMAKE_CURRENT_SOURCE_DIR}/../available_detector.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/../info_collector.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/../info_collector_app.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/../server_utils.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/../result_writer.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/../hotspot_partition_calculator.cpp")

set(MY_SRC_SEARCH_MODE "GLOB")

include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../")

set(MY_PROJ_LIBS
dsn_meta_server
dsn.failure_detector
dsn_utils
dsn.block_service
pegasus_base
pegasus_client_static
event)

set(MY_BOOST_LIBS Boost::system Boost::filesystem)

SET(CMAKE_INSTALL_RPATH ".")
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)

dsn_add_executable()
dsn_install_executable()
50 changes: 50 additions & 0 deletions src/server/collector/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

#include <unistd.h>
#include <memory>

#include "info_collector_app.h"
#include "pegasus_service_app.h"
#include "runtime/app_model.h"
#include "runtime/service_app.h"
#include "server/server_utils.h"
#include "utils/fmt_logging.h"

namespace dsn {
class command_deregister;
} // namespace dsn

int main(int argc, char **argv)
{
static const char server_name[] = "Collector";
if (help(argc, argv, server_name)) {
dsn_exit(0);
}
LOG_INFO("{} starting, pid({}), version({})", server_name, getpid(), pegasus_server_rcsid());

// Register collector service.
dsn::service_app::register_factory<pegasus::server::info_collector_app>("collector");

auto server_info_cmd = register_server_info_cmd();

dsn_run(argc, argv, true);

return 0;
}

0 comments on commit c9c9253

Please sign in to comment.