提交 c5fefa06 编写于 作者: G goerzh

fix function name

上级 e59e8f66
......@@ -53,10 +53,10 @@
#include "b64.h"
extern int applicationCodeRegister(char *grpc_server, char *code);
extern int serviceRegister(char *grpc_server, char *code);
extern int registerInstance(char *grpc_server, int appId, long registertime, char *osname, char *hostname,
int processno, char *ipv4s);
extern int serviceInstanceRegister(char *grpc_server, int appId, long registertime, char *osname, char *hostname,
int processno, char *ipv4s);
/* If you declare any globals in php_skywalking.h uncomment this:
*/
......@@ -819,7 +819,7 @@ static void module_init() {
int i = 0;
do {
application_id = applicationCodeRegister(SKYWALKING_G(grpc), SKYWALKING_G(app_code));
application_id = serviceRegister(SKYWALKING_G(grpc), SKYWALKING_G(app_code));
if(application_id == -100000) {
sleep(1);
......@@ -846,9 +846,9 @@ static void module_init() {
i = 0;
do {
application_instance = registerInstance(SKYWALKING_G(grpc), application_id, millisecond, SKY_OS_NAME,
hostname, getpid(),
ipv4s);
application_instance = serviceInstanceRegister(SKYWALKING_G(grpc), application_id, millisecond, SKY_OS_NAME,
hostname, getpid(),
ipv4s);
if(application_instance == -100000) {
sleep(1);
}
......
......@@ -35,11 +35,16 @@ using grpc::ClientReaderWriter;
using grpc::ClientWriter;
extern "C" int applicationCodeRegister(char *grpc_server, char *service_name);
extern "C" int serviceRegister(char *grpc_server, char *service_name);
extern "C" int
registerInstance(char *grpc_server, int appId, long registertime, char *osname, char *hostname,
int processno, char *ipv4s);
serviceInstanceRegister(char *grpc_server, int appId, long registertime, char *osname, char *hostname,
int processno, char *ipv4s);
extern "C" void networkAddressRegister();
extern "C" void endpointRegister();
static boost::uuids::uuid uuid = boost::uuids::random_generator()();
......@@ -48,7 +53,7 @@ public:
GreeterClient(std::shared_ptr<Channel> channel)
: stub_(Register::NewStub(channel)) {}
int applicationCodeRegister(const std::string &service_name) {
int serviceRegister(const std::string &service_name) {
Services request;
Service *s = request.add_services();
......@@ -74,8 +79,8 @@ public:
return -100000;
}
int registerInstance(int applicationid, long registertime, char *osname, char *hostname, int processno,
char *ipv4s) {
int serviceInstanceRegister(int applicationid, long registertime, char *osname, char *hostname, int processno,
char *ipv4s) {
ServiceInstances request;
ServiceInstance *s = request.add_instances();
......@@ -131,17 +136,17 @@ private:
};
int applicationCodeRegister(char *grpc_server, char *service_name) {
int serviceRegister(char *grpc_server, char *service_name) {
GreeterClient greeter(grpc::CreateChannel(grpc_server, grpc::InsecureChannelCredentials()));
std::string c(service_name);
return greeter.applicationCodeRegister(c);
return greeter.serviceRegister(c);
}
int
registerInstance(char *grpc_server, int appId, long registertime, char *osname, char *hostname,
int processno, char *ipv4s) {
serviceInstanceRegister(char *grpc_server, int appId, long registertime, char *osname, char *hostname,
int processno, char *ipv4s) {
GreeterClient greeter(grpc::CreateChannel(grpc_server, grpc::InsecureChannelCredentials()));
return greeter.registerInstance(appId, registertime, osname, hostname, processno, ipv4s);
return greeter.serviceInstanceRegister(appId, registertime, osname, hostname, processno, ipv4s);
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册