Unverified Commit ccad0cf3 authored by Lemon's avatar Lemon Committed by GitHub

Add language-agent-protocol-v2 support (#136)

* update protocol

* rm azure-pipeline.yml

* move build.ps1 to scripts

* Fix $Script path

* Fix $Script path

* fix version.props path

* Add protocol submodule

* cleanup protocol define

* move build.cake to rootpath

* Add submodule init

* Remove protos submodule

* pre release Protocol

* Agent anomalies do not affect the application

* Update version to 0.7.1

* Add service register v6

* Add ping service

* Fix licenses

* Clean up unused code

* Refactor segment reporter

* Modified version number
parent b8629db1
...@@ -264,3 +264,5 @@ tools/ ...@@ -264,3 +264,5 @@ tools/
*.proto *.proto
generated/
[submodule "protos"] [submodule "src/SkyWalking.Transport.Grpc.Protocol/protocol"]
path = protos path = src/SkyWalking.Transport.Grpc.Protocol/protocol
url = https://github.com/apache/incubator-skywalking-data-collect-protocol.git url = https://github.com/apache/incubator-skywalking-data-collect-protocol.git
...@@ -10,9 +10,11 @@ environment: ...@@ -10,9 +10,11 @@ environment:
skip_commits: skip_commits:
files: files:
- LICENSE - LICENSE
install:
- git submodule update --init
- dotnet build -c Release src/SkyWalking.Transport.Grpc.Protocol
build_script: build_script:
- ps: ./build.ps1 - ps: ./scripts/build.ps1
test: off
artifacts: artifacts:
- path: artifacts/packages/*.nupkg - path: artifacts/packages/*.nupkg
deploy: deploy:
......
# ASP.NET Core
# Build and test ASP.NET Core web applications targeting .NET Core.
# Add steps that run tests, create a NuGet package, deploy, and more:
# https://docs.microsoft.com/vsts/pipelines/languages/dotnet-core
pool:
vmImage: 'Ubuntu 16.04'
variables:
buildConfiguration: 'Release'
steps:
- script: dotnet build --configuration $(buildConfiguration)
displayName: 'dotnet build $(buildConfiguration)'
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<VersionMajor>0</VersionMajor> <VersionMajor>0</VersionMajor>
<VersionMinor>7</VersionMinor> <VersionMinor>8</VersionMinor>
<VersionPatch>0</VersionPatch> <VersionPatch>0</VersionPatch>
<VersionQuality></VersionQuality> <VersionQuality></VersionQuality>
<VersionPrefix>$(VersionMajor).$(VersionMinor).$(VersionPatch)</VersionPrefix> <VersionPrefix>$(VersionMajor).$(VersionMinor).$(VersionPatch)</VersionPrefix>
......
Subproject commit 04e6ecad27f19ee09068e1fdf9a42012dece0f30
...@@ -22,4 +22,7 @@ ...@@ -22,4 +22,7 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="logs" />
</ItemGroup>
</Project> </Project>
\ No newline at end of file
...@@ -13,6 +13,6 @@ ...@@ -13,6 +13,6 @@
} }
}, },
"SkyWalking": { "SkyWalking": {
"ApplicationCode": "asp-net-core-backend" "ServiceName": "asp-net-core-backend"
} }
} }
...@@ -85,6 +85,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyWalking.DotNet.CLI", "cl ...@@ -85,6 +85,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyWalking.DotNet.CLI", "cl
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyWalking.Diagnostics.MySqlData", "src\SkyWalking.Diagnostics.MySqlData\SkyWalking.Diagnostics.MySqlData.csproj", "{A66B2179-9F35-4B52-9457-F60ED257BA60}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyWalking.Diagnostics.MySqlData", "src\SkyWalking.Diagnostics.MySqlData\SkyWalking.Diagnostics.MySqlData.csproj", "{A66B2179-9F35-4B52-9457-F60ED257BA60}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SkyWalking.Transport.Grpc.Protocol", "src\SkyWalking.Transport.Grpc.Protocol\SkyWalking.Transport.Grpc.Protocol.csproj", "{BAF5C1ED-09C4-4B32-8190-47D16265F01E}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
...@@ -179,6 +181,10 @@ Global ...@@ -179,6 +181,10 @@ Global
{A66B2179-9F35-4B52-9457-F60ED257BA60}.Debug|Any CPU.Build.0 = Debug|Any CPU {A66B2179-9F35-4B52-9457-F60ED257BA60}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A66B2179-9F35-4B52-9457-F60ED257BA60}.Release|Any CPU.ActiveCfg = Release|Any CPU {A66B2179-9F35-4B52-9457-F60ED257BA60}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A66B2179-9F35-4B52-9457-F60ED257BA60}.Release|Any CPU.Build.0 = Release|Any CPU {A66B2179-9F35-4B52-9457-F60ED257BA60}.Release|Any CPU.Build.0 = Release|Any CPU
{BAF5C1ED-09C4-4B32-8190-47D16265F01E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BAF5C1ED-09C4-4B32-8190-47D16265F01E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BAF5C1ED-09C4-4B32-8190-47D16265F01E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BAF5C1ED-09C4-4B32-8190-47D16265F01E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
...@@ -213,6 +219,7 @@ Global ...@@ -213,6 +219,7 @@ Global
{5CB2889E-33DD-4326-9403-4977849E065D} = {EF6194B2-9ACB-49B9-8049-DD6AFAEB0399} {5CB2889E-33DD-4326-9403-4977849E065D} = {EF6194B2-9ACB-49B9-8049-DD6AFAEB0399}
{412E5D7D-9448-4C65-8EC7-26F6D5C49865} = {A238D227-433B-461E-8C57-73B147E0F672} {412E5D7D-9448-4C65-8EC7-26F6D5C49865} = {A238D227-433B-461E-8C57-73B147E0F672}
{A66B2179-9F35-4B52-9457-F60ED257BA60} = {79ED86A5-E9B9-49B2-9354-C911C079D03E} {A66B2179-9F35-4B52-9457-F60ED257BA60} = {79ED86A5-E9B9-49B2-9354-C911C079D03E}
{BAF5C1ED-09C4-4B32-8190-47D16265F01E} = {CBFF7EE0-69D7-4D6A-9BBD-8E567FF4D810}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {94C0DA2C-CCCB-4314-93A2-9809B5DD0583} SolutionGuid = {94C0DA2C-CCCB-4314-93A2-9809B5DD0583}
......
...@@ -25,6 +25,8 @@ namespace SkyWalking.Config ...@@ -25,6 +25,8 @@ namespace SkyWalking.Config
public string ApplicationCode { get; set; } public string ApplicationCode { get; set; }
public string ServiceName { get; set; }
public int SpanLimitPerSegment { get; set; } = 300; public int SpanLimitPerSegment { get; set; } = 300;
} }
} }
\ No newline at end of file
...@@ -30,11 +30,9 @@ namespace SkyWalking ...@@ -30,11 +30,9 @@ namespace SkyWalking
protected readonly ILogger Logger; protected readonly ILogger Logger;
protected readonly IRuntimeEnvironment RuntimeEnvironment; protected readonly IRuntimeEnvironment RuntimeEnvironment;
protected readonly ISkyWalkingClient SkyWalking;
protected ExecutionService(ISkyWalkingClient skyWalking, IRuntimeEnvironment runtimeEnvironment, ILoggerFactory loggerFactory) protected ExecutionService(IRuntimeEnvironment runtimeEnvironment, ILoggerFactory loggerFactory)
{ {
SkyWalking = skyWalking;
RuntimeEnvironment = runtimeEnvironment; RuntimeEnvironment = runtimeEnvironment;
Logger = loggerFactory.CreateLogger(GetType()); Logger = loggerFactory.CreateLogger(GetType());
} }
......
...@@ -17,19 +17,18 @@ ...@@ -17,19 +17,18 @@
*/ */
using System; using System;
using SkyWalking.Config;
namespace SkyWalking namespace SkyWalking
{ {
public interface IRuntimeEnvironment public interface IRuntimeEnvironment
{ {
NullableValue ApplicationId { get; } NullableValue ServiceId { get; }
NullableValue ApplicationInstanceId { get; } NullableValue ServiceInstanceId { get; }
bool Initialized { get; } bool Initialized { get; }
Guid AgentUUID { get; } Guid InstanceId { get; }
IEnvironmentProvider Environment { get; } IEnvironmentProvider Environment { get; }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* Licensed to the OpenSkywalking under one or more * Licensed to the OpenSkywalking under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. * this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0 * The OpenSkywalking 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 not use this file except in compliance with
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* *
......
/*
* Licensed to the OpenSkywalking under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenSkywalking 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.
*
*/
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
......
...@@ -24,6 +24,7 @@ using SkyWalking.Transport; ...@@ -24,6 +24,7 @@ using SkyWalking.Transport;
namespace SkyWalking namespace SkyWalking
{ {
[Obsolete]
public interface ISkyWalkingClient public interface ISkyWalkingClient
{ {
Task<NullableValue> RegisterApplicationAsync(string applicationCode, CancellationToken cancellationToken = default(CancellationToken)); Task<NullableValue> RegisterApplicationAsync(string applicationCode, CancellationToken cancellationToken = default(CancellationToken));
......
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
* *
*/ */
using System;
namespace SkyWalking.Transport namespace SkyWalking.Transport
{ {
public class AgentOsInfoRequest public class AgentOsInfoRequest
...@@ -27,5 +29,7 @@ namespace SkyWalking.Transport ...@@ -27,5 +29,7 @@ namespace SkyWalking.Transport
public int ProcessNo { get; set; } public int ProcessNo { get; set; }
public string[] IpAddress { get; set; } public string[] IpAddress { get; set; }
public string Language { get; set; }
} }
} }
\ No newline at end of file
/* /*
* Licensed to the OpenSkywalking under one or more * Licensed to the OpenSkywalking under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. * this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0 * The OpenSkywalking 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 not use this file except in compliance with
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* *
...@@ -16,31 +16,14 @@ ...@@ -16,31 +16,14 @@
* *
*/ */
//using Grpc.Core; using System.Threading;
//using SkyWalking.Utils; using System.Threading.Tasks;
// using SkyWalking.Transport;
//namespace SkyWalking.Remote.Authentication
//{ namespace SkyWalking.Transport
// internal static class AuthenticationInterceptors {
// { public interface IPingCaller
// private const string header = "authentication"; {
// Task PingAsync(PingRequest request, CancellationToken cancellationToken = default(CancellationToken));
// public static AsyncAuthInterceptor CreateAuthInterceptor(string token) }
// { }
// return (context, metadata) => \ No newline at end of file
// {
// var entry = CreateTokenHeader(token);
// if (entry != null)
// {
// metadata.Add(entry);
// }
// return TaskUtils.CompletedTask;
// };
// }
//
// private static Metadata.Entry CreateTokenHeader(string token)
// {
// return string.IsNullOrEmpty(token) ? null : new Metadata.Entry(header, token);
// }
// }
//}
/*
* Licensed to the OpenSkywalking under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenSkywalking 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.
*
*/
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using SkyWalking.Transport;
namespace SkyWalking.Transport
{
public interface IServiceRegister
{
Task<NullableValue> RegisterServiceAsync(ServiceRequest serviceRequest,
CancellationToken cancellationToken = default(CancellationToken));
Task<NullableValue> RegisterServiceInstanceAsync(ServiceInstanceRequest serviceInstanceRequest,
CancellationToken cancellationToken = default(CancellationToken));
}
}
\ No newline at end of file
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace SkyWalking.Transport
{
public interface ITraceReporter
{
Task ReportAsync(IReadOnlyCollection<TraceSegmentRequest> segmentRequests,
CancellationToken cancellationToken = default(CancellationToken));
}
}
\ No newline at end of file
/*
* Licensed to the OpenSkywalking under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenSkywalking 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.
*
*/
namespace SkyWalking.Transport
{
public class PingRequest
{
public int ServiceInstanceId { get; set; }
public string InstanceId { get; set; }
}
}
\ No newline at end of file
/*
* Licensed to the OpenSkywalking under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenSkywalking 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.
*
*/
namespace SkyWalking.Transport
{
public class ServiceInstanceRequest
{
public int ServiceId { get; set; }
public string InstanceUUID { get; set; }
public AgentOsInfoRequest Properties { get; set; }
}
}
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* Licensed to the OpenSkywalking under one or more * Licensed to the OpenSkywalking under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. * this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0 * The OpenSkywalking 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 not use this file except in compliance with
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* *
...@@ -16,21 +16,16 @@ ...@@ -16,21 +16,16 @@
* *
*/ */
namespace SkyWalking.Transport.Grpc using System.Collections.Generic;
namespace SkyWalking.Transport
{ {
public struct ServerMetadata public class ServiceRequest
{ {
public string Address { get; } public string ServiceName { get; set; }
public string Token { get; }
public string CertificatePath { get; } public Dictionary<string, string> Tags { get; set; }
public ServerMetadata(string address, string certificate, string token) public Dictionary<string,string> Properties { get; set; }
{
Address = address;
CertificatePath = certificate;
Token = token;
}
} }
} }
\ No newline at end of file
...@@ -33,6 +33,7 @@ using SkyWalking.Logging; ...@@ -33,6 +33,7 @@ using SkyWalking.Logging;
using SkyWalking.Service; using SkyWalking.Service;
using SkyWalking.Transport; using SkyWalking.Transport;
using SkyWalking.Transport.Grpc; using SkyWalking.Transport.Grpc;
using SkyWalking.Transport.Grpc.V6;
namespace SkyWalking.Agent.AspNetCore namespace SkyWalking.Agent.AspNetCore
{ {
...@@ -48,25 +49,29 @@ namespace SkyWalking.Agent.AspNetCore ...@@ -48,25 +49,29 @@ namespace SkyWalking.Agent.AspNetCore
services.AddSingleton<IContextCarrierFactory, ContextCarrierFactory>(); services.AddSingleton<IContextCarrierFactory, ContextCarrierFactory>();
services.AddSingleton<ITraceDispatcher, AsyncQueueTraceDispatcher>(); services.AddSingleton<ITraceDispatcher, AsyncQueueTraceDispatcher>();
services.AddSingleton<IExecutionService, TraceSegmentTransportService>(); services.AddSingleton<IExecutionService, TraceSegmentTransportService>();
services.AddSingleton<IExecutionService, ServiceDiscoveryService>(); services.AddSingleton<IExecutionService, RegisterService>();
services.AddSingleton<IExecutionService, PingService>();
services.AddSingleton<IExecutionService, SamplingRefreshService>(); services.AddSingleton<IExecutionService, SamplingRefreshService>();
services.AddSingleton<ISkyWalkingAgentStartup, SkyWalkingAgentStartup>(); services.AddSingleton<ISkyWalkingAgentStartup, SkyWalkingAgentStartup>();
services.AddSingleton<ISampler>(DefaultSampler.Instance); services.AddSingleton<ISampler>(DefaultSampler.Instance);
services.AddSingleton(RuntimeEnvironment.Instance); services.AddSingleton<IRuntimeEnvironment>(RuntimeEnvironment.Instance);
services.AddSingleton<TracingDiagnosticProcessorObserver>(); services.AddSingleton<TracingDiagnosticProcessorObserver>();
services.AddSingleton<IConfigAccessor, ConfigAccessor>(); services.AddSingleton<IConfigAccessor, ConfigAccessor>();
services.AddSingleton<IHostedService, InstrumentationHostedService>(); services.AddSingleton<IHostedService, InstrumentationHostedService>();
services.AddSingleton<IEnvironmentProvider, HostingEnvironmentProvider>(); services.AddSingleton<IEnvironmentProvider, HostingEnvironmentProvider>();
services.AddGrpcTransport().AddLogging(); services.AddGrpcTransport().AddLogging();
services.AddSkyWalkingExtensions().AddAspNetCoreHosting().AddHttpClient().AddSqlClient().AddEntityFrameworkCore(c => c.AddPomeloMysql().AddNpgsql().AddSqlite()); services.AddSkyWalkingExtensions().AddAspNetCoreHosting().AddHttpClient().AddSqlClient()
.AddEntityFrameworkCore(c => c.AddPomeloMysql().AddNpgsql().AddSqlite());
return services; return services;
} }
private static IServiceCollection AddGrpcTransport(this IServiceCollection services) private static IServiceCollection AddGrpcTransport(this IServiceCollection services)
{ {
services.AddSingleton<ISkyWalkingClient, GrpcClient>(); services.AddSingleton<ITraceReporter, TraceReporter>();
services.AddSingleton<ConnectionManager>(); services.AddSingleton<ConnectionManager>();
services.AddSingleton<IExecutionService, GrpcStateCheckService>(); services.AddSingleton<IPingCaller, PingCaller>();
services.AddSingleton<IServiceRegister, ServiceRegister>();
services.AddSingleton<IExecutionService, ConnectService>();
return services; return services;
} }
......
...@@ -24,6 +24,7 @@ using SkyWalking.Logging; ...@@ -24,6 +24,7 @@ using SkyWalking.Logging;
using SkyWalking.Service; using SkyWalking.Service;
using SkyWalking.Transport; using SkyWalking.Transport;
using SkyWalking.Transport.Grpc; using SkyWalking.Transport.Grpc;
using SkyWalking.Transport.Grpc.V6;
using SkyWalking.Utilities.Configuration; using SkyWalking.Utilities.Configuration;
using SkyWalking.Utilities.Logging; using SkyWalking.Utilities.Logging;
...@@ -33,22 +34,24 @@ namespace SkyWalking.AspNet.Extensions ...@@ -33,22 +34,24 @@ namespace SkyWalking.AspNet.Extensions
{ {
public static IServiceCollection AddSkyWalkingCore(this IServiceCollection services) public static IServiceCollection AddSkyWalkingCore(this IServiceCollection services)
{ {
services.AddSingleton<SkyWalkingApplicationRequestCallback>();
services.AddSingleton<IContextCarrierFactory, ContextCarrierFactory>(); services.AddSingleton<IContextCarrierFactory, ContextCarrierFactory>();
services.AddSingleton<ITraceDispatcher, AsyncQueueTraceDispatcher>(); services.AddSingleton<ITraceDispatcher, AsyncQueueTraceDispatcher>();
services.AddSingleton<IExecutionService, TraceSegmentTransportService>(); services.AddSingleton<IExecutionService, TraceSegmentTransportService>();
services.AddSingleton<IExecutionService, ServiceDiscoveryService>(); services.AddSingleton<IExecutionService, RegisterService>();
services.AddSingleton<IExecutionService, PingService>();
services.AddSingleton<IExecutionService, SamplingRefreshService>(); services.AddSingleton<IExecutionService, SamplingRefreshService>();
services.AddSingleton<ISkyWalkingAgentStartup, SkyWalkingAgentStartup>(); services.AddSingleton<ISkyWalkingAgentStartup, SkyWalkingAgentStartup>();
services.AddSingleton<ISampler>(DefaultSampler.Instance);
services.AddSingleton<IRuntimeEnvironment>(RuntimeEnvironment.Instance);
services.AddSingleton<TracingDiagnosticProcessorObserver>(); services.AddSingleton<TracingDiagnosticProcessorObserver>();
services.AddSingleton<IConfigAccessor, ConfigAccessor>(); services.AddSingleton<IConfigAccessor, ConfigAccessor>();
services.AddSingleton<IEnvironmentProvider, HostingEnvironmentProvider>(); services.AddSingleton<IEnvironmentProvider, HostingEnvironmentProvider>();
services.AddSingleton<ILoggerFactory, DefaultLoggerFactory>(); services.AddSingleton<ITraceReporter, TraceReporter>();
services.AddSingleton<ISkyWalkingClient, GrpcClient>();
services.AddSingleton<ConnectionManager>(); services.AddSingleton<ConnectionManager>();
services.AddSingleton<IExecutionService, GrpcStateCheckService>(); services.AddSingleton<IPingCaller, PingCaller>();
services.AddSingleton<ISampler>(DefaultSampler.Instance); services.AddSingleton<IServiceRegister, ServiceRegister>();
services.AddSingleton(RuntimeEnvironment.Instance); services.AddSingleton<IExecutionService, ConnectService>();
services.AddSingleton<ILoggerFactory, DefaultLoggerFactory>();
return services; return services;
} }
} }
......
...@@ -27,7 +27,7 @@ namespace SkyWalking.Context.Ids ...@@ -27,7 +27,7 @@ namespace SkyWalking.Context.Ids
public static ID Generate() public static ID Generate()
{ {
if (!RuntimeEnvironment.Instance.ApplicationInstanceId.HasValue) if (!RuntimeEnvironment.Instance.ServiceInstanceId.HasValue)
{ {
throw new InvalidOperationException(); throw new InvalidOperationException();
} }
...@@ -35,7 +35,7 @@ namespace SkyWalking.Context.Ids ...@@ -35,7 +35,7 @@ namespace SkyWalking.Context.Ids
IDContext context = threadIdSequence.Value; IDContext context = threadIdSequence.Value;
return new ID( return new ID(
RuntimeEnvironment.Instance.ApplicationInstanceId.Value, RuntimeEnvironment.Instance.ServiceInstanceId.Value,
Thread.CurrentThread.ManagedThreadId, Thread.CurrentThread.ManagedThreadId,
context.NextSeq() context.NextSeq()
); );
......
...@@ -30,9 +30,9 @@ namespace SkyWalking.Context.Trace ...@@ -30,9 +30,9 @@ namespace SkyWalking.Context.Trace
private readonly DistributedTraceIdCollection _relatedGlobalTraces; private readonly DistributedTraceIdCollection _relatedGlobalTraces;
private bool _isSizeLimited; private bool _isSizeLimited;
public int ApplicationId => RuntimeEnvironment.Instance.ApplicationId.Value; public int ApplicationId => RuntimeEnvironment.Instance.ServiceId.Value;
public int ApplicationInstanceId => RuntimeEnvironment.Instance.ApplicationInstanceId.Value; public int ApplicationInstanceId => RuntimeEnvironment.Instance.ServiceInstanceId.Value;
public IEnumerable<ITraceSegmentRef> Refs => _refs; public IEnumerable<ITraceSegmentRef> Refs => _refs;
......
...@@ -80,7 +80,7 @@ namespace SkyWalking.Context.Trace ...@@ -80,7 +80,7 @@ namespace SkyWalking.Context.Trace
_type = SegmentRefType.CrossThread; _type = SegmentRefType.CrossThread;
_traceSegmentId = contextSnapshot.TraceSegmentId; _traceSegmentId = contextSnapshot.TraceSegmentId;
_spanId = contextSnapshot.SpanId; _spanId = contextSnapshot.SpanId;
_parentApplicationInstanceId = RuntimeEnvironment.Instance.ApplicationInstanceId.Value; _parentApplicationInstanceId = RuntimeEnvironment.Instance.ServiceInstanceId.Value;
_entryApplicationInstanceId = contextSnapshot.EntryApplicationInstanceId; _entryApplicationInstanceId = contextSnapshot.EntryApplicationInstanceId;
string entryOperationName = contextSnapshot.EntryOperationName; string entryOperationName = contextSnapshot.EntryOperationName;
if (entryOperationName.First() == '#') if (entryOperationName.First() == '#')
......
...@@ -18,16 +18,20 @@ ...@@ -18,16 +18,20 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using SkyWalking.Logging;
namespace SkyWalking.Diagnostics namespace SkyWalking.Diagnostics
{ {
internal class TracingDiagnosticObserver : IObserver<KeyValuePair<string, object>> internal class TracingDiagnosticObserver : IObserver<KeyValuePair<string, object>>
{ {
private readonly TracingDiagnosticMethodCollection _methodCollection; private readonly TracingDiagnosticMethodCollection _methodCollection;
private readonly ILogger _logger;
public TracingDiagnosticObserver(ITracingDiagnosticProcessor tracingDiagnosticProcessor) public TracingDiagnosticObserver(ITracingDiagnosticProcessor tracingDiagnosticProcessor,
ILoggerFactory loggerFactory)
{ {
_methodCollection = new TracingDiagnosticMethodCollection(tracingDiagnosticProcessor); _methodCollection = new TracingDiagnosticMethodCollection(tracingDiagnosticProcessor);
_logger = loggerFactory.CreateLogger(typeof(TracingDiagnosticObserver));
} }
public void OnCompleted() public void OnCompleted()
...@@ -41,9 +45,16 @@ namespace SkyWalking.Diagnostics ...@@ -41,9 +45,16 @@ namespace SkyWalking.Diagnostics
public void OnNext(KeyValuePair<string, object> value) public void OnNext(KeyValuePair<string, object> value)
{ {
foreach (var method in _methodCollection) foreach (var method in _methodCollection)
{
try
{ {
method.Invoke(value.Key, value.Value); method.Invoke(value.Key, value.Value);
} }
catch (Exception exception)
{
_logger.Error("Invoke diagnostic method exception.", exception);
}
}
} }
} }
} }
\ No newline at end of file
...@@ -27,11 +27,14 @@ namespace SkyWalking.Diagnostics ...@@ -27,11 +27,14 @@ namespace SkyWalking.Diagnostics
public class TracingDiagnosticProcessorObserver : IObserver<DiagnosticListener> public class TracingDiagnosticProcessorObserver : IObserver<DiagnosticListener>
{ {
private readonly ILogger _logger; private readonly ILogger _logger;
private readonly ILoggerFactory _loggerFactory;
private readonly IEnumerable<ITracingDiagnosticProcessor> _tracingDiagnosticProcessors; private readonly IEnumerable<ITracingDiagnosticProcessor> _tracingDiagnosticProcessors;
public TracingDiagnosticProcessorObserver(IEnumerable<ITracingDiagnosticProcessor> tracingDiagnosticProcessors, ILoggerFactory loggerFactory) public TracingDiagnosticProcessorObserver(IEnumerable<ITracingDiagnosticProcessor> tracingDiagnosticProcessors,
ILoggerFactory loggerFactory)
{ {
_logger = loggerFactory.CreateLogger(typeof(TracingDiagnosticProcessorObserver)); _logger = loggerFactory.CreateLogger(typeof(TracingDiagnosticProcessorObserver));
_loggerFactory = loggerFactory;
_tracingDiagnosticProcessors = tracingDiagnosticProcessors ?? _tracingDiagnosticProcessors = tracingDiagnosticProcessors ??
throw new ArgumentNullException(nameof(tracingDiagnosticProcessors)); throw new ArgumentNullException(nameof(tracingDiagnosticProcessors));
} }
...@@ -60,7 +63,7 @@ namespace SkyWalking.Diagnostics ...@@ -60,7 +63,7 @@ namespace SkyWalking.Diagnostics
protected virtual void Subscribe(DiagnosticListener listener, protected virtual void Subscribe(DiagnosticListener listener,
ITracingDiagnosticProcessor tracingDiagnosticProcessor) ITracingDiagnosticProcessor tracingDiagnosticProcessor)
{ {
listener.Subscribe(new TracingDiagnosticObserver(tracingDiagnosticProcessor)); listener.Subscribe(new TracingDiagnosticObserver(tracingDiagnosticProcessor, _loggerFactory));
} }
} }
} }
\ No newline at end of file
///*
// * Licensed to the OpenSkywalking 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.
// *
// */
//
//using System;
//using System.Collections.Generic;
//using System.Diagnostics;
//using System.Linq;
//using System.Net;
//using System.Net.Sockets;
//using System.Threading;
//using System.Threading.Tasks;
//using SkyWalking.Boot;
//using SkyWalking.Config;
//using SkyWalking.Context;
//using SkyWalking.Dictionarys;
//using SkyWalking.Logging;
//using SkyWalking.NetworkProtocol;
//using SkyWalking.Utils;
//
//namespace SkyWalking.Remote
//{
// public class GrpcApplicationService : TimerService
// {
// private static readonly ILogger Logger = LogManager.GetLogger<GrpcApplicationService>();
// public override int Order { get; } = -1;
//
// protected override TimeSpan Interval { get; } = TimeSpan.FromSeconds(15);
//
// protected override async Task Execute(CancellationToken token)
// {
// if (!DictionaryUtil.IsNull(RemoteDownstreamConfig.Agent.ApplicationId) &&
// !DictionaryUtil.IsNull(RemoteDownstreamConfig.Agent.ApplicationInstanceId))
// {
// return;
// }
//
// if (string.IsNullOrEmpty(AgentConfig.ApplicationCode))
// {
// return;
// }
//
// if (!GrpcConnectionManager.Instance.Available)
// {
// return;
// }
//
// var availableConnection = GrpcConnectionManager.Instance.GetAvailableConnection();
//
// if (availableConnection == null)
// {
// return;
// }
//
// try
// {
// await RegisterApplication(availableConnection, token);
// await RegisterApplicationInstance(availableConnection, token);
// }
// catch (Exception exception)
// {
// Logger.Warning($"Register application fail. {exception.Message}");
// availableConnection.Failure();
// }
// }
//
// private async Task RegisterApplication(GrpcConnection availableConnection, CancellationToken token)
// {
// if (DictionaryUtil.IsNull(RemoteDownstreamConfig.Agent.ApplicationId))
// {
// var application = new Application {ApplicationCode = AgentConfig.ApplicationCode};
// var applicationRegisterService =
// new ApplicationRegisterService.ApplicationRegisterServiceClient(availableConnection.GrpcChannel);
//
// var retry = 0;
// var applicationId = 0;
// while (retry++ < 3 && DictionaryUtil.IsNull(applicationId))
// {
// var applicationMapping = await applicationRegisterService.applicationCodeRegisterAsync(application);
// applicationId = applicationMapping?.Application?.Value ?? 0;
// if (!DictionaryUtil.IsNull(applicationId))
// {
// break;
// }
// await Task.Delay(500, token);
// }
//
// if (DictionaryUtil.IsNull(applicationId))
// {
// Logger.Warning(
// "Register application fail. Server response null.");
// return;
// }
//
// Logger.Information(
// $"Register application success. [applicationCode] = {application.ApplicationCode}. [applicationId] = {applicationId}");
// RemoteDownstreamConfig.Agent.ApplicationId = applicationId;
// }
// }
//
// private async Task RegisterApplicationInstance(GrpcConnection availableConnection, CancellationToken token)
// {
// if (!DictionaryUtil.IsNull(RemoteDownstreamConfig.Agent.ApplicationId) && DictionaryUtil.IsNull(RemoteDownstreamConfig.Agent.ApplicationInstanceId))
// {
// var instanceDiscoveryService =
// new InstanceDiscoveryService.InstanceDiscoveryServiceClient(availableConnection.GrpcChannel);
//
// var agentUUID = Guid.NewGuid().ToString("N");
// var registerTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
//
// var hostName = Dns.GetHostName();
//
// var osInfo = new OSInfo
// {
// Hostname = hostName,
// OsName = PlatformInformation.GetOSName(),
// ProcessNo = Process.GetCurrentProcess().Id
// };
//
// osInfo.Ipv4S.AddRange(GetIpV4S(hostName));
//
// var applicationInstance = new ApplicationInstance
// {
// ApplicationId = RemoteDownstreamConfig.Agent.ApplicationId,
// AgentUUID = agentUUID,
// RegisterTime = registerTime,
// Osinfo = osInfo
// };
//
// var retry = 0;
// var applicationInstanceId = 0;
// while (retry++ < 5 && DictionaryUtil.IsNull(applicationInstanceId))
// {
// var applicationInstanceMapping = await instanceDiscoveryService.registerInstanceAsync(applicationInstance);
// applicationInstanceId = applicationInstanceMapping.ApplicationInstanceId;
// if (!DictionaryUtil.IsNull(applicationInstanceId))
// {
// break;
// }
//
// await Task.Delay(500, token);
// }
//
// if (!DictionaryUtil.IsNull(applicationInstanceId))
// {
// RemoteDownstreamConfig.Agent.ApplicationInstanceId = applicationInstanceId;
// Logger.Information(
// $"Register application instance success. [applicationInstanceId] = {applicationInstanceId}");
// }
// else
// {
// Logger.Warning(
// "Register application instance fail. Server response null.");
// }
// }
// }
//
// private IEnumerable<string> GetIpV4S(string hostName)
// {
// try
// {
//
// var ipAddresses = Dns.GetHostAddresses(hostName);
// var ipV4S = new List<string>();
// foreach (var ipAddress in ipAddresses.Where(x => x.AddressFamily == AddressFamily.InterNetwork))
// ipV4S.Add(ipAddress.ToString());
// return ipV4S;
// }
// catch (Exception e)
// {
// Logger.Warning($"Get host addresses fail. {e.Message}");
// return new string[0];
// }
// }
// }
//}
\ No newline at end of file
///*
// * Licensed to the OpenSkywalking 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.
// *
// */
//
//using Grpc.Core;
//using SkyWalking.Remote.Authentication;
//
//namespace SkyWalking.Remote
//{
// internal class GrpcChannelBuilder
// {
// private string _token;
//
// private string _server;
//
// private string _rootCertificatePath;
//
// public GrpcChannelBuilder WithAuthenticationToken(string token)
// {
// _token = token;
// return this;
// }
//
// public GrpcChannelBuilder WithServer(string server)
// {
// _server = server;
// return this;
// }
//
// public GrpcChannelBuilder WithCredential(string rootCertificatePath)
// {
// _rootCertificatePath = rootCertificatePath;
// return this;
// }
//
// public Channel Build()
// {
// return new Channel(_server, GetCredentials());
// }
//
// private ChannelCredentials GetCredentials()
// {
// if (_rootCertificatePath != null)
// {
// var authInterceptor = AuthenticationInterceptors.CreateAuthInterceptor(_token);
// return ChannelCredentials.Create(new SslCredentials(), CallCredentials.FromInterceptor(authInterceptor));
// }
//
// return ChannelCredentials.Insecure;
// }
// }
//}
///*
// * Licensed to the OpenSkywalking 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.
// *
// */
//
//using System;
//using System.Threading.Tasks;
//using Grpc.Core;
//using SkyWalking.Logging;
//
//namespace SkyWalking.Remote
//{
// public class GrpcConnection
// {
// private static readonly ILogger Logger = LogManager.GetLogger<GrpcConnection>();
//
// public Channel GrpcChannel { get; }
//
// public GrpcConnectionState State { get; private set; } = GrpcConnectionState.Idle;
//
// public string Server { get; }
//
// public GrpcConnection(string server, string rootCertificatePath = null, string token = null)
// {
// Server = server;
// GrpcChannel = new GrpcChannelBuilder()
// .WithServer(server)
// .WithCredential(rootCertificatePath)
// .WithAuthenticationToken(token)
// .Build();
// }
//
// public async Task<bool> ConnectAsync(TimeSpan timeout)
// {
// if (State == GrpcConnectionState.Ready)
// {
// return true;
// }
// State = GrpcConnectionState.Connecting;
// try
// {
// var deadLine = DateTime.UtcNow.AddSeconds(timeout.TotalSeconds);
// await GrpcChannel.ConnectAsync(deadLine);
// State = GrpcConnectionState.Ready;
// Logger.Information($"Grpc channel connect success. [Server] = {GrpcChannel.Target}");
// }
// catch (TaskCanceledException ex)
// {
// State = GrpcConnectionState.Failure;
// Logger.Warning($"Grpc channel connect timeout. {ex.Message}");
// }
// catch (Exception ex)
// {
// State = GrpcConnectionState.Failure;
// Logger.Warning($"Grpc channel connect fail. {ex.Message}");
// }
//
// return State == GrpcConnectionState.Ready;
// }
//
// public async Task ShutdowmAsync()
// {
// try
// {
// await GrpcChannel.ShutdownAsync();
// }
// catch (Exception e)
// {
// Logger.Debug($"Grpc channel shutdown fail. {e.Message}");
// }
// finally
// {
// State = GrpcConnectionState.Shutdown;
// }
// }
//
// public bool CheckState()
// {
// return State == GrpcConnectionState.Ready && GrpcChannel.State == ChannelState.Ready;
// }
//
// public void Failure()
// {
// var currentState = State;
//
// if (GrpcConnectionState.Ready == currentState)
// {
// Logger.Debug($"Grpc channel state changed. {State} -> {GrpcChannel.State}");
// }
//
// State = GrpcConnectionState.Failure;
// }
// }
//}
\ No newline at end of file
///*
// * Licensed to the OpenSkywalking 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.
// *
// */
//
//using System;
//using System.Linq;
//using System.Threading.Tasks;
//using SkyWalking.Config;
//using SkyWalking.Logging;
//using SkyWalking.Utils;
//
//namespace SkyWalking.Remote
//{
// public class GrpcConnectionManager
// {
// private static readonly ILogger Logger = LogManager.GetLogger<GrpcConnectionManager>();
//
// public const string NotFoundErrorMessage = "Not found available connection.";
//
// public static GrpcConnectionManager Instance { get; } = new GrpcConnectionManager();
//
// private readonly Random _random = new Random();
// private readonly AsyncLock _lock = new AsyncLock();
// private GrpcConnection _connection;
//
// public bool Available => _connection != null && _connection.CheckState();
//
// private GrpcConnectionManager()
// {
// }
//
// public async Task ConnectAsync(TimeSpan timeout)
// {
// // using async lock
// using (await _lock.LockAsync())
// {
// if (_connection != null && _connection.CheckState())
// {
// return;
// }
//
// if (_connection != null && !_connection.CheckState())
// {
// await _connection.ShutdowmAsync();
// }
//
// var metadata = GetServerMetadata(_connection?.Server);
// _connection = new GrpcConnection(metadata.Address, metadata.CertificatePath, metadata.Token);
// await _connection.ConnectAsync(timeout);
// }
// }
//
// public async Task ShutdownAsync()
// {
// await _connection?.ShutdowmAsync();
// }
//
// public GrpcConnection GetAvailableConnection()
// {
// var connection = _connection;
// if (connection == null || connection.State != GrpcConnectionState.Ready)
// {
// Logger.Debug(NotFoundErrorMessage);
// return null;
// }
//
// return connection;
// }
//
// private ServerMetadata GetServerMetadata(string currentServer)
// {
// return new ServerMetadata(GetServerAddress(currentServer),
// CollectorConfig.CertificatePath, CollectorConfig.Authentication);
// }
//
// private string GetServerAddress(string currentServer)
// {
// var servers = RemoteDownstreamConfig.Collector.gRPCServers.Distinct().ToArray();
// if (servers.Length == 1)
// {
// return servers[0];
// }
//
// if (currentServer != null)
// {
// servers = servers.Where(x => x != currentServer).ToArray();
// }
//
// var index = _random.Next() % servers.Length;
// return servers[index];
// }
//
// public struct ServerMetadata
// {
// public string Address { get; }
//
// public string Token { get; }
//
// public string CertificatePath { get; }
//
// public ServerMetadata(string address, string certificate, string token)
// {
// Address = address;
// CertificatePath = certificate;
// Token = token;
// }
// }
// }
//}
\ No newline at end of file
///*
// * Licensed to the OpenSkywalking 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.
// *
// */
//
//using System;
//using System.Threading;
//using System.Threading.Tasks;
//using SkyWalking.Boot;
//
//namespace SkyWalking.Remote
//{
// public class GrpcConnectionService : TimerService
// {
// protected override TimeSpan Interval { get; } = TimeSpan.FromSeconds(15);
//
// protected override async Task Execute(CancellationToken token)
// {
// if (!GrpcConnectionManager.Instance.Available)
// {
// // default timeout = 5s
// await GrpcConnectionManager.Instance.ConnectAsync(TimeSpan.FromSeconds(5));
// }
// }
// }
//}
\ No newline at end of file
///*
// * Licensed to the OpenSkywalking 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.
// *
// */
//
//namespace SkyWalking.Remote
//{
// public enum GrpcConnectionState
// {
// Idle,
// Connecting,
// Ready,
// Failure,
// Shutdown
// }
//}
///*
// * Licensed to the OpenSkywalking 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.
// *
// */
//
//using System;
//using System.Threading;
//using System.Threading.Tasks;
//using SkyWalking.Boot;
//using SkyWalking.Config;
//using SkyWalking.Dictionarys;
//using SkyWalking.Logging;
//using SkyWalking.NetworkProtocol;
//using SkyWalking.Utils;
//
//namespace SkyWalking.Remote
//{
// public class GrpcHeartbeatService : TimerService
// {
// private static readonly ILogger Logger = LogManager.GetLogger<GrpcHeartbeatService>();
// protected override TimeSpan Interval { get; } = TimeSpan.FromMinutes(1);
//
// protected override async Task Starting(CancellationToken token)
// {
// await Task.Delay(TimeSpan.FromMinutes(1), token);
// }
//
// protected override async Task Execute(CancellationToken token)
// {
// if (DictionaryUtil.IsNull(RemoteDownstreamConfig.Agent.ApplicationInstanceId))
// {
// Logger.Debug($"{DateTime.Now} Heartbeat fail. Application instance is not registered.");
// return;
// }
//
// var availableConnection = GrpcConnectionManager.Instance.GetAvailableConnection();
//
// if (availableConnection == null)
// {
// Logger.Debug($"{DateTime.Now} Heartbeat fail. {GrpcConnectionManager.NotFoundErrorMessage}");
// return;
// }
//
// try
// {
// var instanceDiscoveryService =
// new InstanceDiscoveryService.InstanceDiscoveryServiceClient(availableConnection.GrpcChannel);
//
// var heartbeat = new ApplicationInstanceHeartbeat
// {
// ApplicationInstanceId = RemoteDownstreamConfig.Agent.ApplicationInstanceId,
// HeartbeatTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
// };
//
// await instanceDiscoveryService.heartbeatAsync(heartbeat);
//
// Logger.Debug($"{DateTime.Now} Heartbeat.");
// }
// catch (Exception e)
// {
// Logger.Debug($"{DateTime.Now} Heartbeat fail. {e.Message}");
// availableConnection.Failure();
// }
// }
// }
//}
\ No newline at end of file
///*
// * Licensed to the OpenSkywalking 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.
// *
// */
//
//using System;
//using System.Threading;
//using System.Threading.Tasks;
//using SkyWalking.Boot;
//using SkyWalking.Utils;
//
//namespace SkyWalking.Remote
//{
// public class GrpcRuntimeService : TimerService
// {
// protected override TimeSpan Interval { get; } = TimeSpan.FromSeconds(120);
//
// protected override Task Execute(CancellationToken token)
// {
// // todo
// return TaskUtils.CompletedTask;
// }
// }
//}
\ No newline at end of file
///*
// * Licensed to the OpenSkywalking 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.
// *
// */
//
//using System;
//using System.Collections.Concurrent;
//using System.Collections.Generic;
//using System.Linq;
//using System.Threading;
//using System.Threading.Tasks;
//using SkyWalking.Boot;
//using SkyWalking.Config;
//using SkyWalking.Context;
//using SkyWalking.Context.Trace;
//using SkyWalking.Logging;
//using SkyWalking.NetworkProtocol;
//using SkyWalking.Utils;
//
//namespace SkyWalking.Remote
//{
// public class GrpcTraceSegmentService : TimerService, ITracingContextListener
// {
// private static readonly ILogger Logger = LogManager.GetLogger<GrpcTraceSegmentService>();
// private static readonly ConcurrentQueue<ITraceSegment> _traceSegments
// = new ConcurrentQueue<ITraceSegment>();
//
// public override void Dispose()
// {
// TracingContext.ListenerManager.Remove(this);
// if (_traceSegments.Count > 0)
// {
// BatchSendTraceSegments().ConfigureAwait(false).GetAwaiter().GetResult();
// }
// base.Dispose();
// }
//
// public override int Order { get; } = 1;
//
// protected override TimeSpan Interval => TimeSpan.FromSeconds(1);
//
// protected override Task Initializing(CancellationToken token)
// {
// TracingContext.ListenerManager.Add(this);
// return base.Initializing(token);
// }
//
// public void AfterFinished(ITraceSegment traceSegment)
// {
// if (traceSegment.IsIgnore)
// {
// return;
// }
//
// if (_traceSegments.Count >= AgentConfig.PendingSegmentLimit && AgentConfig.PendingSegmentLimit > 0)
// {
// _traceSegments.TryDequeue(out var v);
// }
// _traceSegments.Enqueue(traceSegment);
// }
//
// protected override async Task Execute(CancellationToken token)
// {
// await BatchSendTraceSegments();
// }
//
// private async Task BatchSendTraceSegments()
// {
// if (_traceSegments.Count == 0)
// return;
//
// var availableConnection = GrpcConnectionManager.Instance.GetAvailableConnection();
// if (availableConnection == null)
// {
// Logger.Warning(
// $"Transform and send UpstreamSegment to collector fail. {GrpcConnectionManager.NotFoundErrorMessage}");
// return;
// }
//
// try
// {
// var traceSegmentService =
// new TraceSegmentService.TraceSegmentServiceClient(availableConnection.GrpcChannel);
// using (var asyncClientStreamingCall = traceSegmentService.collect())
// {
// while (_traceSegments.TryDequeue(out var segment))
// {
// await asyncClientStreamingCall.RequestStream.WriteAsync(segment.Transform());
// Logger.Debug(
// $"Transform and send UpstreamSegment to collector. [TraceSegmentId] = {segment.TraceSegmentId} [GlobalTraceId] = {segment.RelatedGlobalTraces.FirstOrDefault()}");
// }
// await asyncClientStreamingCall.RequestStream.CompleteAsync();
// await asyncClientStreamingCall.ResponseAsync;
// }
// }
// catch (Exception e)
// {
// Logger.Warning($"Transform and send UpstreamSegment to collector fail. {e.Message}");
// availableConnection?.Failure();
// return;
// }
// }
// }
//}
\ No newline at end of file
...@@ -24,13 +24,13 @@ namespace SkyWalking ...@@ -24,13 +24,13 @@ namespace SkyWalking
{ {
public static IRuntimeEnvironment Instance { get; } = new RuntimeEnvironment(); public static IRuntimeEnvironment Instance { get; } = new RuntimeEnvironment();
public NullableValue ApplicationId { get; internal set; } public NullableValue ServiceId { get; internal set; }
public NullableValue ApplicationInstanceId { get; internal set; } public NullableValue ServiceInstanceId { get; internal set; }
public bool Initialized => ApplicationId.HasValue && ApplicationInstanceId.HasValue; public bool Initialized => ServiceId.HasValue && ServiceInstanceId.HasValue;
public Guid AgentUUID { get; } = Guid.NewGuid(); public Guid InstanceId { get; } = Guid.NewGuid();
public IEnvironmentProvider Environment { get; set; } public IEnvironmentProvider Environment { get; set; }
} }
......
/*
* Licensed to the OpenSkywalking 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.
*
*/
using System;
using System.Threading;
using System.Threading.Tasks;
using SkyWalking.Logging;
using SkyWalking.Transport;
namespace SkyWalking.Service
{
public class PingService : ExecutionService
{
private readonly IPingCaller _pingCaller;
public PingService(IPingCaller pingCaller, IRuntimeEnvironment runtimeEnvironment,
ILoggerFactory loggerFactory) : base(
runtimeEnvironment, loggerFactory)
{
_pingCaller = pingCaller;
}
protected override TimeSpan DueTime { get; } = TimeSpan.FromSeconds(30);
protected override TimeSpan Period { get; } = TimeSpan.FromSeconds(60);
protected override async Task ExecuteAsync(CancellationToken cancellationToken)
{
try
{
await _pingCaller.PingAsync(
new PingRequest
{
ServiceInstanceId = RuntimeEnvironment.ServiceInstanceId.Value,
InstanceId = RuntimeEnvironment.InstanceId.ToString("N")
}, cancellationToken);
Logger.Information($"Ping server @{DateTimeOffset.UtcNow}");
}
catch (Exception exception)
{
Logger.Error($"Ping server fail @{DateTimeOffset.UtcNow}", exception);
}
}
}
}
\ No newline at end of file
/*
* Licensed to the OpenSkywalking 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.
*
*/
using System; using System;
using System.Diagnostics; using System.Diagnostics;
using System.Threading; using System.Threading;
...@@ -27,66 +9,81 @@ using SkyWalking.Utils; ...@@ -27,66 +9,81 @@ using SkyWalking.Utils;
namespace SkyWalking.Service namespace SkyWalking.Service
{ {
public class ServiceDiscoveryService : ExecutionService public class RegisterService : ExecutionService
{ {
private readonly InstrumentationConfig _config; private readonly InstrumentationConfig _config;
private readonly IServiceRegister _serviceRegister;
public RegisterService(IConfigAccessor configAccessor, IServiceRegister serviceRegister,
IRuntimeEnvironment runtimeEnvironment, ILoggerFactory loggerFactory) : base(runtimeEnvironment,
loggerFactory)
{
_serviceRegister = serviceRegister;
_config = configAccessor.Get<InstrumentationConfig>();
}
protected override TimeSpan DueTime { get; } = TimeSpan.Zero; protected override TimeSpan DueTime { get; } = TimeSpan.Zero;
protected override TimeSpan Period { get; } = TimeSpan.FromSeconds(30); protected override TimeSpan Period { get; } = TimeSpan.FromSeconds(30);
public ServiceDiscoveryService(IConfigAccessor configAccessor, ISkyWalkingClient client, protected override bool CanExecute() => true;
IRuntimeEnvironment runtimeEnvironment, ILoggerFactory loggerFactory)
: base(client, runtimeEnvironment, loggerFactory)
{
_config = configAccessor.Get<InstrumentationConfig>();
}
protected override async Task ExecuteAsync(CancellationToken cancellationToken) protected override async Task ExecuteAsync(CancellationToken cancellationToken)
{ {
await RegisterApplication(cancellationToken); await RegisterServiceAsync(cancellationToken);
await RegisterApplicationInstance(cancellationToken); await RegisterServiceInstanceAsync(cancellationToken);
await Heartbeat(cancellationToken);
} }
protected override bool CanExecute() => true; private async Task RegisterServiceAsync(CancellationToken cancellationToken)
{
private async Task RegisterApplication(CancellationToken cancellationToken) if (!RuntimeEnvironment.ServiceId.HasValue)
{ {
if (!RuntimeEnvironment.ApplicationId.HasValue) var request = new ServiceRequest
{ {
var value = await Polling(3, () => SkyWalking.RegisterApplicationAsync(_config.ApplicationCode, cancellationToken), cancellationToken); ServiceName = _config.ServiceName ?? _config.ApplicationCode
};
var value = await Polling(3,
() => _serviceRegister.RegisterServiceAsync(request, cancellationToken),
cancellationToken);
if (value.HasValue && RuntimeEnvironment is RuntimeEnvironment environment) if (value.HasValue && RuntimeEnvironment is RuntimeEnvironment environment)
{ {
environment.ApplicationId = value; environment.ServiceId = value;
Logger.Information($"Registered Application[Id={environment.ApplicationId.Value}]."); Logger.Information($"Registered Service[Id={environment.ServiceId.Value}].");
} }
} }
} }
private async Task RegisterApplicationInstance(CancellationToken cancellationToken) private async Task RegisterServiceInstanceAsync(CancellationToken cancellationToken)
{ {
if (RuntimeEnvironment.ApplicationId.HasValue && !RuntimeEnvironment.ApplicationInstanceId.HasValue) if (RuntimeEnvironment.ServiceId.HasValue && !RuntimeEnvironment.ServiceInstanceId.HasValue)
{ {
var osInfoRequest = new AgentOsInfoRequest var properties = new AgentOsInfoRequest
{ {
HostName = DnsHelpers.GetHostName(), HostName = DnsHelpers.GetHostName(),
IpAddress = DnsHelpers.GetIpV4s(), IpAddress = DnsHelpers.GetIpV4s(),
OsName = PlatformInformation.GetOSName(), OsName = PlatformInformation.GetOSName(),
ProcessNo = Process.GetCurrentProcess().Id ProcessNo = Process.GetCurrentProcess().Id,
Language = "dotnet"
};
var request = new ServiceInstanceRequest
{
ServiceId = RuntimeEnvironment.ServiceId.Value,
InstanceUUID = RuntimeEnvironment.InstanceId.ToString("N"),
Properties = properties
}; };
var value = await Polling(3, var value = await Polling(3,
() => SkyWalking.RegisterApplicationInstanceAsync(RuntimeEnvironment.ApplicationId.Value, RuntimeEnvironment.AgentUUID, () => _serviceRegister.RegisterServiceInstanceAsync(request, cancellationToken),
DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(), osInfoRequest, cancellationToken), cancellationToken); cancellationToken);
if (value.HasValue && RuntimeEnvironment is RuntimeEnvironment environment) if (value.HasValue && RuntimeEnvironment is RuntimeEnvironment environment)
{ {
environment.ApplicationInstanceId = value; environment.ServiceInstanceId = value;
Logger.Information($"Registered Application Instance[Id={environment.ApplicationInstanceId.Value}]."); Logger.Information($"Registered ServiceInstance[Id={environment.ServiceInstanceId.Value}].");
} }
} }
} }
private static async Task<NullableValue> Polling(int retry, Func<Task<NullableValue>> execute, CancellationToken cancellationToken) private static async Task<NullableValue> Polling(int retry, Func<Task<NullableValue>> execute,
CancellationToken cancellationToken)
{ {
var index = 0; var index = 0;
while (index++ < retry) while (index++ < retry)
...@@ -102,21 +99,5 @@ namespace SkyWalking.Service ...@@ -102,21 +99,5 @@ namespace SkyWalking.Service
return NullableValue.Null; return NullableValue.Null;
} }
private async Task Heartbeat(CancellationToken cancellationToken)
{
if (RuntimeEnvironment.Initialized)
{
try
{
await SkyWalking.HeartbeatAsync(RuntimeEnvironment.ApplicationInstanceId.Value, DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(), cancellationToken);
Logger.Debug($"Heartbeat at {DateTimeOffset.UtcNow}.");
}
catch (Exception e)
{
Logger.Error("Heartbeat error.", e);
}
}
}
} }
} }
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* Licensed to the OpenSkywalking under one or more * Licensed to the OpenSkywalking under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. * this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0 * The OpenSkywalking 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 not use this file except in compliance with
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* *
...@@ -28,9 +28,9 @@ namespace SkyWalking.Service ...@@ -28,9 +28,9 @@ namespace SkyWalking.Service
{ {
private readonly SamplingConfig _config; private readonly SamplingConfig _config;
public SamplingRefreshService(IConfigAccessor configAccessor, ISkyWalkingClient skyWalking, public SamplingRefreshService(IConfigAccessor configAccessor,
IRuntimeEnvironment runtimeEnvironment, ILoggerFactory loggerFactory) IRuntimeEnvironment runtimeEnvironment, ILoggerFactory loggerFactory)
: base(skyWalking, runtimeEnvironment, loggerFactory) : base(runtimeEnvironment, loggerFactory)
{ {
_config = configAccessor.Get<SamplingConfig>(); _config = configAccessor.Get<SamplingConfig>();
DefaultSampler.Instance.SetSamplePer3Secs(_config.SamplePer3Secs); DefaultSampler.Instance.SetSamplePer3Secs(_config.SamplePer3Secs);
......
...@@ -33,8 +33,8 @@ namespace SkyWalking.Service ...@@ -33,8 +33,8 @@ namespace SkyWalking.Service
private readonly ITraceDispatcher _dispatcher; private readonly ITraceDispatcher _dispatcher;
public TraceSegmentTransportService(IConfigAccessor configAccessor, ITraceDispatcher dispatcher, public TraceSegmentTransportService(IConfigAccessor configAccessor, ITraceDispatcher dispatcher,
ISkyWalkingClient skyWalking, IRuntimeEnvironment runtimeEnvironment, ILoggerFactory loggerFactory) IRuntimeEnvironment runtimeEnvironment, ILoggerFactory loggerFactory)
: base(skyWalking, runtimeEnvironment, loggerFactory) : base(runtimeEnvironment, loggerFactory)
{ {
_dispatcher = dispatcher; _dispatcher = dispatcher;
_config = configAccessor.Get<TransportConfig>(); _config = configAccessor.Get<TransportConfig>();
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* Licensed to the OpenSkywalking under one or more * Licensed to the OpenSkywalking under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. * this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0 * The OpenSkywalking 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 not use this file except in compliance with
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* *
...@@ -29,13 +29,14 @@ namespace SkyWalking.Transport ...@@ -29,13 +29,14 @@ namespace SkyWalking.Transport
{ {
private readonly ILogger _logger; private readonly ILogger _logger;
private readonly TransportConfig _config; private readonly TransportConfig _config;
private readonly ISkyWalkingClient _skyWalkingClient; private readonly ITraceReporter _traceReporter;
private readonly ConcurrentQueue<TraceSegmentRequest> _segmentQueue; private readonly ConcurrentQueue<TraceSegmentRequest> _segmentQueue;
private readonly CancellationTokenSource _cancellation; private readonly CancellationTokenSource _cancellation;
public AsyncQueueTraceDispatcher(IConfigAccessor configAccessor, ISkyWalkingClient client, ILoggerFactory loggerFactory) public AsyncQueueTraceDispatcher(IConfigAccessor configAccessor, ITraceReporter traceReporter,
ILoggerFactory loggerFactory)
{ {
_skyWalkingClient = client; _traceReporter = traceReporter;
_logger = loggerFactory.CreateLogger(typeof(AsyncQueueTraceDispatcher)); _logger = loggerFactory.CreateLogger(typeof(AsyncQueueTraceDispatcher));
_config = configAccessor.Get<TransportConfig>(); _config = configAccessor.Get<TransportConfig>();
_segmentQueue = new ConcurrentQueue<TraceSegmentRequest>(); _segmentQueue = new ConcurrentQueue<TraceSegmentRequest>();
...@@ -71,7 +72,7 @@ namespace SkyWalking.Transport ...@@ -71,7 +72,7 @@ namespace SkyWalking.Transport
// send async // send async
if (segments.Count > 0) if (segments.Count > 0)
_skyWalkingClient.CollectAsync(segments, token); _traceReporter.ReportAsync(segments, token);
return Task.CompletedTask; return Task.CompletedTask;
} }
......
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\build\common.props" />
<PropertyGroup>
<Description>SkyWalking gRPC data transmitter.</Description>
<AssemblyTitle>SkyWalking.Transport.Grpc.Protocol</AssemblyTitle>
<AssemblyName>SkyWalking.Transport.Grpc.Protocol</AssemblyName>
<PackageId>SkyWalking.Transport.Grpc.Protocol</PackageId>
<PackageTags>SkyWalking;Grpc</PackageTags>
<PackageReleaseNotes>
</PackageReleaseNotes>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Google.Protobuf" Version="3.6.1" />
<PackageReference Include="Grpc" Version="1.17.0" />
<PackageReference Include="Grpc.Tools" Version="1.17.0" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
<Protobuf Include="protocol/**/*.proto" ProtoRoot="protocol" OutputDir="%(RelativePath)generated" CompileOutputs="false" />
</ItemGroup>
<PropertyGroup>
<Protobuf_NoWarnMissingExpected>true</Protobuf_NoWarnMissingExpected>
<Protobuf_TouchMissingExpected>true</Protobuf_TouchMissingExpected>
</PropertyGroup>
</Project>
Subproject commit b66fa070fd647662f06497e4ed3657eb258cb6e9
...@@ -65,20 +65,19 @@ namespace SkyWalking.Transport.Grpc ...@@ -65,20 +65,19 @@ namespace SkyWalking.Transport.Grpc
try try
{ {
var deadLine = DateTime.UtcNow.AddMilliseconds(_config.ConnectTimeout); await _channel.ConnectAsync(_config.GetConnectTimeout());
await _channel.ConnectAsync(deadLine);
_state = ConnectionState.Connected; _state = ConnectionState.Connected;
_logger.Information($"Connected collector server[{_channel.Target}]."); _logger.Information($"Connected server[{_channel.Target}].");
} }
catch (TaskCanceledException ex) catch (TaskCanceledException ex)
{ {
_state = ConnectionState.Failure; _state = ConnectionState.Failure;
_logger.Error($"Connect collector timeout.", ex); _logger.Error($"Connect server timeout.", ex);
} }
catch (Exception ex) catch (Exception ex)
{ {
_state = ConnectionState.Failure; _state = ConnectionState.Failure;
_logger.Error($"Connect collector fail.", ex); _logger.Error($"Connect server fail.", ex);
} }
} }
} }
......
/*
* Licensed to the OpenSkywalking 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.
*
*/
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using SkyWalking.Config;
using SkyWalking.Logging;
using SkyWalking.NetworkProtocol;
namespace SkyWalking.Transport.Grpc
{
public class GrpcClient : ISkyWalkingClient
{
private readonly ConnectionManager _connectionManager;
private readonly ILogger _logger;
private readonly GrpcConfig _config;
public GrpcClient(ConnectionManager connectionManager, IConfigAccessor configAccessor, ILoggerFactory loggerFactory)
{
_connectionManager = connectionManager;
_config = configAccessor.Get<GrpcConfig>();
_logger = loggerFactory.CreateLogger(typeof(GrpcClient));
}
public async Task<NullableValue> RegisterApplicationAsync(string applicationCode, CancellationToken cancellationToken = default(CancellationToken))
{
if (!_connectionManager.Ready)
{
return NullableValue.Null;
}
var connection = _connectionManager.GetConnection();
var client = new ApplicationRegisterService.ApplicationRegisterServiceClient(connection);
return await ExecuteWithCatch(async () =>
{
var applicationMapping = await client.applicationCodeRegisterAsync(new Application {ApplicationCode = applicationCode},
null, _config.GetTimeout(), cancellationToken);
return new NullableValue(applicationMapping?.Application?.Value ?? 0);
},
() => NullableValue.Null,
() => ExceptionHelpers.RegisterApplicationError);
}
public async Task<NullableValue> RegisterApplicationInstanceAsync(int applicationId, Guid agentUUID, long registerTime, AgentOsInfoRequest osInfoRequest,
CancellationToken cancellationToken = default(CancellationToken))
{
if (!_connectionManager.Ready)
{
return NullableValue.Null;
}
var connection = _connectionManager.GetConnection();
var client = new InstanceDiscoveryService.InstanceDiscoveryServiceClient(connection);
var applicationInstance = new ApplicationInstance
{
ApplicationId = applicationId,
AgentUUID = agentUUID.ToString("N"),
RegisterTime = registerTime,
Osinfo = new OSInfo
{
OsName = osInfoRequest.OsName,
Hostname = osInfoRequest.HostName,
ProcessNo = osInfoRequest.ProcessNo
}
};
applicationInstance.Osinfo.Ipv4S.AddRange(osInfoRequest.IpAddress);
return await ExecuteWithCatch(async () =>
{
var applicationInstanceMapping = await client.registerInstanceAsync(applicationInstance, null, _config.GetTimeout(), cancellationToken);
return new NullableValue(applicationInstanceMapping?.ApplicationInstanceId ?? 0);
},
() => NullableValue.Null,
() => ExceptionHelpers.RegisterApplicationInstanceError);
}
public async Task HeartbeatAsync(int applicationInstance, long heartbeatTime, CancellationToken cancellationToken = default(CancellationToken))
{
if (!_connectionManager.Ready)
{
return;
}
var connection = _connectionManager.GetConnection();
var client = new InstanceDiscoveryService.InstanceDiscoveryServiceClient(connection);
var heartbeat = new ApplicationInstanceHeartbeat
{
ApplicationInstanceId = applicationInstance,
HeartbeatTime = heartbeatTime
};
await ExecuteWithCatch(async () => await client.heartbeatAsync(heartbeat, null, _config.GetTimeout(), cancellationToken), () => ExceptionHelpers.HeartbeatError);
}
public async Task CollectAsync(IEnumerable<TraceSegmentRequest> request, CancellationToken cancellationToken = default(CancellationToken))
{
if (!_connectionManager.Ready)
{
return;
}
var connection = _connectionManager.GetConnection();
var client = new TraceSegmentService.TraceSegmentServiceClient(connection);
try
{
using (var asyncClientStreamingCall = client.collect(null, null, cancellationToken))
{
foreach (var segment in request)
await asyncClientStreamingCall.RequestStream.WriteAsync(TraceSegmentHelpers.Map(segment));
await asyncClientStreamingCall.RequestStream.CompleteAsync();
await asyncClientStreamingCall.ResponseAsync;
}
}
catch (Exception ex)
{
_logger.Error("Heartbeat error.", ex);
_connectionManager.Failure(ex);
}
}
private async Task ExecuteWithCatch(Func<Task> task, Func<string> errMessage)
{
try
{
await task();
}
catch (Exception ex)
{
_logger.Error(errMessage(), ex);
_connectionManager.Failure(ex);
}
}
private async Task<T> ExecuteWithCatch<T>(Func<Task<T>> task, Func<T> errCallback, Func<string> errMessage)
{
try
{
return await task();
}
catch (Exception ex)
{
_logger.Error(errMessage(), ex);
_connectionManager.Failure(ex);
return errCallback();
}
}
}
}
\ No newline at end of file
...@@ -21,7 +21,7 @@ using SkyWalking.Config; ...@@ -21,7 +21,7 @@ using SkyWalking.Config;
namespace SkyWalking.Transport.Grpc namespace SkyWalking.Transport.Grpc
{ {
[Config("SkyWalking", "Transport","gRPC")] [Config("SkyWalking", "Transport", "gRPC")]
public class GrpcConfig public class GrpcConfig
{ {
public string Servers { get; set; } public string Servers { get; set; }
...@@ -29,6 +29,8 @@ namespace SkyWalking.Transport.Grpc ...@@ -29,6 +29,8 @@ namespace SkyWalking.Transport.Grpc
public int ConnectTimeout { get; set; } public int ConnectTimeout { get; set; }
public int Timeout { get; set; } public int Timeout { get; set; }
public int ReportTimeout { get; set; }
} }
public static class GrpcConfigExtensions public static class GrpcConfigExtensions
...@@ -37,5 +39,15 @@ namespace SkyWalking.Transport.Grpc ...@@ -37,5 +39,15 @@ namespace SkyWalking.Transport.Grpc
{ {
return DateTime.UtcNow.AddMilliseconds(config.Timeout); return DateTime.UtcNow.AddMilliseconds(config.Timeout);
} }
public static DateTime GetConnectTimeout(this GrpcConfig config)
{
return DateTime.UtcNow.AddMilliseconds(config.ConnectTimeout);
}
public static DateTime GetReportTimeout(this GrpcConfig config)
{
return DateTime.UtcNow.AddMilliseconds(config.ReportTimeout);
}
} }
} }
\ No newline at end of file
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: ApplicationRegisterService.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace SkyWalking.NetworkProtocol {
/// <summary>Holder for reflection information generated from ApplicationRegisterService.proto</summary>
public static partial class ApplicationRegisterServiceReflection {
#region Descriptor
/// <summary>File descriptor for ApplicationRegisterService.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static ApplicationRegisterServiceReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CiBBcHBsaWNhdGlvblJlZ2lzdGVyU2VydmljZS5wcm90bxoZS2V5V2l0aElu",
"dGVnZXJWYWx1ZS5wcm90byImCgtBcHBsaWNhdGlvbhIXCg9hcHBsaWNhdGlv",
"bkNvZGUYASABKAkiPwoSQXBwbGljYXRpb25NYXBwaW5nEikKC2FwcGxpY2F0",
"aW9uGAEgASgLMhQuS2V5V2l0aEludGVnZXJWYWx1ZTJcChpBcHBsaWNhdGlv",
"blJlZ2lzdGVyU2VydmljZRI+ChdhcHBsaWNhdGlvbkNvZGVSZWdpc3RlchIM",
"LkFwcGxpY2F0aW9uGhMuQXBwbGljYXRpb25NYXBwaW5nIgBCSAonb3JnLmFw",
"YWNoZS5za3l3YWxraW5nLmFwbS5uZXR3b3JrLnByb3RvUAGqAhpTa3lXYWxr",
"aW5nLk5ldHdvcmtQcm90b2NvbGIGcHJvdG8z"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::SkyWalking.NetworkProtocol.KeyWithIntegerValueReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::SkyWalking.NetworkProtocol.Application), global::SkyWalking.NetworkProtocol.Application.Parser, new[]{ "ApplicationCode" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::SkyWalking.NetworkProtocol.ApplicationMapping), global::SkyWalking.NetworkProtocol.ApplicationMapping.Parser, new[]{ "Application" }, null, null, null)
}));
}
#endregion
}
#region Messages
public sealed partial class Application : pb::IMessage<Application> {
private static readonly pb::MessageParser<Application> _parser = new pb::MessageParser<Application>(() => new Application());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Application> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::SkyWalking.NetworkProtocol.ApplicationRegisterServiceReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Application() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Application(Application other) : this() {
applicationCode_ = other.applicationCode_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Application Clone() {
return new Application(this);
}
/// <summary>Field number for the "applicationCode" field.</summary>
public const int ApplicationCodeFieldNumber = 1;
private string applicationCode_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string ApplicationCode {
get { return applicationCode_; }
set {
applicationCode_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as Application);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(Application other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (ApplicationCode != other.ApplicationCode) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (ApplicationCode.Length != 0) hash ^= ApplicationCode.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (ApplicationCode.Length != 0) {
output.WriteRawTag(10);
output.WriteString(ApplicationCode);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (ApplicationCode.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(ApplicationCode);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(Application other) {
if (other == null) {
return;
}
if (other.ApplicationCode.Length != 0) {
ApplicationCode = other.ApplicationCode;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
ApplicationCode = input.ReadString();
break;
}
}
}
}
}
public sealed partial class ApplicationMapping : pb::IMessage<ApplicationMapping> {
private static readonly pb::MessageParser<ApplicationMapping> _parser = new pb::MessageParser<ApplicationMapping>(() => new ApplicationMapping());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ApplicationMapping> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::SkyWalking.NetworkProtocol.ApplicationRegisterServiceReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ApplicationMapping() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ApplicationMapping(ApplicationMapping other) : this() {
application_ = other.application_ != null ? other.application_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ApplicationMapping Clone() {
return new ApplicationMapping(this);
}
/// <summary>Field number for the "application" field.</summary>
public const int ApplicationFieldNumber = 1;
private global::SkyWalking.NetworkProtocol.KeyWithIntegerValue application_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::SkyWalking.NetworkProtocol.KeyWithIntegerValue Application {
get { return application_; }
set {
application_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as ApplicationMapping);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(ApplicationMapping other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (!object.Equals(Application, other.Application)) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (application_ != null) hash ^= Application.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (application_ != null) {
output.WriteRawTag(10);
output.WriteMessage(Application);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (application_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Application);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(ApplicationMapping other) {
if (other == null) {
return;
}
if (other.application_ != null) {
if (application_ == null) {
application_ = new global::SkyWalking.NetworkProtocol.KeyWithIntegerValue();
}
Application.MergeFrom(other.Application);
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
if (application_ == null) {
application_ = new global::SkyWalking.NetworkProtocol.KeyWithIntegerValue();
}
input.ReadMessage(application_);
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: ApplicationRegisterService.proto
// </auto-generated>
#pragma warning disable 0414, 1591
#region Designer generated code
using grpc = global::Grpc.Core;
namespace SkyWalking.NetworkProtocol {
/// <summary>
///register service for ApplicationCode, this service is called when service starts.
/// </summary>
public static partial class ApplicationRegisterService
{
static readonly string __ServiceName = "ApplicationRegisterService";
static readonly grpc::Marshaller<global::SkyWalking.NetworkProtocol.Application> __Marshaller_Application = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::SkyWalking.NetworkProtocol.Application.Parser.ParseFrom);
static readonly grpc::Marshaller<global::SkyWalking.NetworkProtocol.ApplicationMapping> __Marshaller_ApplicationMapping = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::SkyWalking.NetworkProtocol.ApplicationMapping.Parser.ParseFrom);
static readonly grpc::Method<global::SkyWalking.NetworkProtocol.Application, global::SkyWalking.NetworkProtocol.ApplicationMapping> __Method_applicationCodeRegister = new grpc::Method<global::SkyWalking.NetworkProtocol.Application, global::SkyWalking.NetworkProtocol.ApplicationMapping>(
grpc::MethodType.Unary,
__ServiceName,
"applicationCodeRegister",
__Marshaller_Application,
__Marshaller_ApplicationMapping);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
{
get { return global::SkyWalking.NetworkProtocol.ApplicationRegisterServiceReflection.Descriptor.Services[0]; }
}
/// <summary>Base class for server-side implementations of ApplicationRegisterService</summary>
public abstract partial class ApplicationRegisterServiceBase
{
public virtual global::System.Threading.Tasks.Task<global::SkyWalking.NetworkProtocol.ApplicationMapping> applicationCodeRegister(global::SkyWalking.NetworkProtocol.Application request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
}
/// <summary>Client for ApplicationRegisterService</summary>
public partial class ApplicationRegisterServiceClient : grpc::ClientBase<ApplicationRegisterServiceClient>
{
/// <summary>Creates a new client for ApplicationRegisterService</summary>
/// <param name="channel">The channel to use to make remote calls.</param>
public ApplicationRegisterServiceClient(grpc::Channel channel) : base(channel)
{
}
/// <summary>Creates a new client for ApplicationRegisterService that uses a custom <c>CallInvoker</c>.</summary>
/// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
public ApplicationRegisterServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker)
{
}
/// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
protected ApplicationRegisterServiceClient() : base()
{
}
/// <summary>Protected constructor to allow creation of configured clients.</summary>
/// <param name="configuration">The client configuration.</param>
protected ApplicationRegisterServiceClient(ClientBaseConfiguration configuration) : base(configuration)
{
}
public virtual global::SkyWalking.NetworkProtocol.ApplicationMapping applicationCodeRegister(global::SkyWalking.NetworkProtocol.Application request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return applicationCodeRegister(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
public virtual global::SkyWalking.NetworkProtocol.ApplicationMapping applicationCodeRegister(global::SkyWalking.NetworkProtocol.Application request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_applicationCodeRegister, null, options, request);
}
public virtual grpc::AsyncUnaryCall<global::SkyWalking.NetworkProtocol.ApplicationMapping> applicationCodeRegisterAsync(global::SkyWalking.NetworkProtocol.Application request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return applicationCodeRegisterAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
public virtual grpc::AsyncUnaryCall<global::SkyWalking.NetworkProtocol.ApplicationMapping> applicationCodeRegisterAsync(global::SkyWalking.NetworkProtocol.Application request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_applicationCodeRegister, null, options, request);
}
/// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
protected override ApplicationRegisterServiceClient NewInstance(ClientBaseConfiguration configuration)
{
return new ApplicationRegisterServiceClient(configuration);
}
}
/// <summary>Creates service definition that can be registered with a server</summary>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static grpc::ServerServiceDefinition BindService(ApplicationRegisterServiceBase serviceImpl)
{
return grpc::ServerServiceDefinition.CreateBuilder()
.AddMethod(__Method_applicationCodeRegister, serviceImpl.applicationCodeRegister).Build();
}
}
}
#endregion
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: Common.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace SkyWalking.NetworkProtocol {
/// <summary>Holder for reflection information generated from Common.proto</summary>
public static partial class CommonReflection {
#region Descriptor
/// <summary>File descriptor for Common.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static CommonReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CgxDb21tb24ucHJvdG8qKgoIU3BhblR5cGUSCQoFRW50cnkQABIICgRFeGl0",
"EAESCQoFTG9jYWwQAkJICidvcmcuYXBhY2hlLnNreXdhbGtpbmcuYXBtLm5l",
"dHdvcmsucHJvdG9QAaoCGlNreVdhbGtpbmcuTmV0d29ya1Byb3RvY29sYgZw",
"cm90bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(new[] {typeof(global::SkyWalking.NetworkProtocol.SpanType), }, null));
}
#endregion
}
#region Enums
public enum SpanType {
[pbr::OriginalName("Entry")] Entry = 0,
[pbr::OriginalName("Exit")] Exit = 1,
[pbr::OriginalName("Local")] Local = 2,
}
#endregion
}
#endregion Designer generated code
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: DiscoveryService.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace SkyWalking.NetworkProtocol {
/// <summary>Holder for reflection information generated from DiscoveryService.proto</summary>
public static partial class DiscoveryServiceReflection {
#region Descriptor
/// <summary>File descriptor for DiscoveryService.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static DiscoveryServiceReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"ChZEaXNjb3ZlcnlTZXJ2aWNlLnByb3RvGgxDb21tb24ucHJvdG8aEERvd25z",
"dHJlYW0ucHJvdG8ibgoTQXBwbGljYXRpb25JbnN0YW5jZRIVCg1hcHBsaWNh",
"dGlvbklkGAEgASgFEhEKCWFnZW50VVVJRBgCIAEoCRIUCgxyZWdpc3RlclRp",
"bWUYAyABKAMSFwoGb3NpbmZvGAQgASgLMgcuT1NJbmZvIlIKGkFwcGxpY2F0",
"aW9uSW5zdGFuY2VNYXBwaW5nEhUKDWFwcGxpY2F0aW9uSWQYASABKAUSHQoV",
"YXBwbGljYXRpb25JbnN0YW5jZUlkGAIgASgFIoEBChpBcHBsaWNhdGlvbklu",
"c3RhbmNlUmVjb3ZlchIVCg1hcHBsaWNhdGlvbklkGAEgASgFEh0KFWFwcGxp",
"Y2F0aW9uSW5zdGFuY2VJZBgCIAEoBRIUCgxyZWdpc3RlclRpbWUYAyABKAMS",
"FwoGb3NpbmZvGAQgASgLMgcuT1NJbmZvIlQKHEFwcGxpY2F0aW9uSW5zdGFu",
"Y2VIZWFydGJlYXQSHQoVYXBwbGljYXRpb25JbnN0YW5jZUlkGAEgASgFEhUK",
"DWhlYXJ0YmVhdFRpbWUYAiABKAMiTAoGT1NJbmZvEg4KBm9zTmFtZRgBIAEo",
"CRIQCghob3N0bmFtZRgCIAEoCRIRCglwcm9jZXNzTm8YAyABKAUSDQoFaXB2",
"NHMYBCADKAkiPgoVU2VydmljZU5hbWVDb2xsZWN0aW9uEiUKCGVsZW1lbnRz",
"GAEgAygLMhMuU2VydmljZU5hbWVFbGVtZW50IkwKHFNlcnZpY2VOYW1lTWFw",
"cGluZ0NvbGxlY3Rpb24SLAoIZWxlbWVudHMYASADKAsyGi5TZXJ2aWNlTmFt",
"ZU1hcHBpbmdFbGVtZW50IlQKGVNlcnZpY2VOYW1lTWFwcGluZ0VsZW1lbnQS",
"EQoJc2VydmljZUlkGAEgASgFEiQKB2VsZW1lbnQYAiABKAsyEy5TZXJ2aWNl",
"TmFtZUVsZW1lbnQiYAoSU2VydmljZU5hbWVFbGVtZW50EhMKC3NlcnZpY2VO",
"YW1lGAEgASgJEhUKDWFwcGxpY2F0aW9uSWQYAiABKAUSHgoLc3JjU3BhblR5",
"cGUYAyABKA4yCS5TcGFuVHlwZTKeAQoYSW5zdGFuY2VEaXNjb3ZlcnlTZXJ2",
"aWNlEkcKEHJlZ2lzdGVySW5zdGFuY2USFC5BcHBsaWNhdGlvbkluc3RhbmNl",
"GhsuQXBwbGljYXRpb25JbnN0YW5jZU1hcHBpbmciABI5CgloZWFydGJlYXQS",
"HS5BcHBsaWNhdGlvbkluc3RhbmNlSGVhcnRiZWF0GgsuRG93bnN0cmVhbSIA",
"MmMKG1NlcnZpY2VOYW1lRGlzY292ZXJ5U2VydmljZRJECglkaXNjb3ZlcnkS",
"Fi5TZXJ2aWNlTmFtZUNvbGxlY3Rpb24aHS5TZXJ2aWNlTmFtZU1hcHBpbmdD",
"b2xsZWN0aW9uIgBCSAonb3JnLmFwYWNoZS5za3l3YWxraW5nLmFwbS5uZXR3",
"b3JrLnByb3RvUAGqAhpTa3lXYWxraW5nLk5ldHdvcmtQcm90b2NvbGIGcHJv",
"dG8z"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::SkyWalking.NetworkProtocol.CommonReflection.Descriptor, global::SkyWalking.NetworkProtocol.DownstreamReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::SkyWalking.NetworkProtocol.ApplicationInstance), global::SkyWalking.NetworkProtocol.ApplicationInstance.Parser, new[]{ "ApplicationId", "AgentUUID", "RegisterTime", "Osinfo" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::SkyWalking.NetworkProtocol.ApplicationInstanceMapping), global::SkyWalking.NetworkProtocol.ApplicationInstanceMapping.Parser, new[]{ "ApplicationId", "ApplicationInstanceId" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::SkyWalking.NetworkProtocol.ApplicationInstanceRecover), global::SkyWalking.NetworkProtocol.ApplicationInstanceRecover.Parser, new[]{ "ApplicationId", "ApplicationInstanceId", "RegisterTime", "Osinfo" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::SkyWalking.NetworkProtocol.ApplicationInstanceHeartbeat), global::SkyWalking.NetworkProtocol.ApplicationInstanceHeartbeat.Parser, new[]{ "ApplicationInstanceId", "HeartbeatTime" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::SkyWalking.NetworkProtocol.OSInfo), global::SkyWalking.NetworkProtocol.OSInfo.Parser, new[]{ "OsName", "Hostname", "ProcessNo", "Ipv4S" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::SkyWalking.NetworkProtocol.ServiceNameCollection), global::SkyWalking.NetworkProtocol.ServiceNameCollection.Parser, new[]{ "Elements" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::SkyWalking.NetworkProtocol.ServiceNameMappingCollection), global::SkyWalking.NetworkProtocol.ServiceNameMappingCollection.Parser, new[]{ "Elements" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::SkyWalking.NetworkProtocol.ServiceNameMappingElement), global::SkyWalking.NetworkProtocol.ServiceNameMappingElement.Parser, new[]{ "ServiceId", "Element" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::SkyWalking.NetworkProtocol.ServiceNameElement), global::SkyWalking.NetworkProtocol.ServiceNameElement.Parser, new[]{ "ServiceName", "ApplicationId", "SrcSpanType" }, null, null, null)
}));
}
#endregion
}
#region Messages
public sealed partial class ApplicationInstance : pb::IMessage<ApplicationInstance> {
private static readonly pb::MessageParser<ApplicationInstance> _parser = new pb::MessageParser<ApplicationInstance>(() => new ApplicationInstance());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ApplicationInstance> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::SkyWalking.NetworkProtocol.DiscoveryServiceReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ApplicationInstance() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ApplicationInstance(ApplicationInstance other) : this() {
applicationId_ = other.applicationId_;
agentUUID_ = other.agentUUID_;
registerTime_ = other.registerTime_;
osinfo_ = other.osinfo_ != null ? other.osinfo_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ApplicationInstance Clone() {
return new ApplicationInstance(this);
}
/// <summary>Field number for the "applicationId" field.</summary>
public const int ApplicationIdFieldNumber = 1;
private int applicationId_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int ApplicationId {
get { return applicationId_; }
set {
applicationId_ = value;
}
}
/// <summary>Field number for the "agentUUID" field.</summary>
public const int AgentUUIDFieldNumber = 2;
private string agentUUID_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string AgentUUID {
get { return agentUUID_; }
set {
agentUUID_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "registerTime" field.</summary>
public const int RegisterTimeFieldNumber = 3;
private long registerTime_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long RegisterTime {
get { return registerTime_; }
set {
registerTime_ = value;
}
}
/// <summary>Field number for the "osinfo" field.</summary>
public const int OsinfoFieldNumber = 4;
private global::SkyWalking.NetworkProtocol.OSInfo osinfo_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::SkyWalking.NetworkProtocol.OSInfo Osinfo {
get { return osinfo_; }
set {
osinfo_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as ApplicationInstance);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(ApplicationInstance other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (ApplicationId != other.ApplicationId) return false;
if (AgentUUID != other.AgentUUID) return false;
if (RegisterTime != other.RegisterTime) return false;
if (!object.Equals(Osinfo, other.Osinfo)) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (ApplicationId != 0) hash ^= ApplicationId.GetHashCode();
if (AgentUUID.Length != 0) hash ^= AgentUUID.GetHashCode();
if (RegisterTime != 0L) hash ^= RegisterTime.GetHashCode();
if (osinfo_ != null) hash ^= Osinfo.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (ApplicationId != 0) {
output.WriteRawTag(8);
output.WriteInt32(ApplicationId);
}
if (AgentUUID.Length != 0) {
output.WriteRawTag(18);
output.WriteString(AgentUUID);
}
if (RegisterTime != 0L) {
output.WriteRawTag(24);
output.WriteInt64(RegisterTime);
}
if (osinfo_ != null) {
output.WriteRawTag(34);
output.WriteMessage(Osinfo);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (ApplicationId != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(ApplicationId);
}
if (AgentUUID.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(AgentUUID);
}
if (RegisterTime != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(RegisterTime);
}
if (osinfo_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Osinfo);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(ApplicationInstance other) {
if (other == null) {
return;
}
if (other.ApplicationId != 0) {
ApplicationId = other.ApplicationId;
}
if (other.AgentUUID.Length != 0) {
AgentUUID = other.AgentUUID;
}
if (other.RegisterTime != 0L) {
RegisterTime = other.RegisterTime;
}
if (other.osinfo_ != null) {
if (osinfo_ == null) {
osinfo_ = new global::SkyWalking.NetworkProtocol.OSInfo();
}
Osinfo.MergeFrom(other.Osinfo);
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
ApplicationId = input.ReadInt32();
break;
}
case 18: {
AgentUUID = input.ReadString();
break;
}
case 24: {
RegisterTime = input.ReadInt64();
break;
}
case 34: {
if (osinfo_ == null) {
osinfo_ = new global::SkyWalking.NetworkProtocol.OSInfo();
}
input.ReadMessage(osinfo_);
break;
}
}
}
}
}
public sealed partial class ApplicationInstanceMapping : pb::IMessage<ApplicationInstanceMapping> {
private static readonly pb::MessageParser<ApplicationInstanceMapping> _parser = new pb::MessageParser<ApplicationInstanceMapping>(() => new ApplicationInstanceMapping());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ApplicationInstanceMapping> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::SkyWalking.NetworkProtocol.DiscoveryServiceReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ApplicationInstanceMapping() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ApplicationInstanceMapping(ApplicationInstanceMapping other) : this() {
applicationId_ = other.applicationId_;
applicationInstanceId_ = other.applicationInstanceId_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ApplicationInstanceMapping Clone() {
return new ApplicationInstanceMapping(this);
}
/// <summary>Field number for the "applicationId" field.</summary>
public const int ApplicationIdFieldNumber = 1;
private int applicationId_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int ApplicationId {
get { return applicationId_; }
set {
applicationId_ = value;
}
}
/// <summary>Field number for the "applicationInstanceId" field.</summary>
public const int ApplicationInstanceIdFieldNumber = 2;
private int applicationInstanceId_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int ApplicationInstanceId {
get { return applicationInstanceId_; }
set {
applicationInstanceId_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as ApplicationInstanceMapping);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(ApplicationInstanceMapping other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (ApplicationId != other.ApplicationId) return false;
if (ApplicationInstanceId != other.ApplicationInstanceId) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (ApplicationId != 0) hash ^= ApplicationId.GetHashCode();
if (ApplicationInstanceId != 0) hash ^= ApplicationInstanceId.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (ApplicationId != 0) {
output.WriteRawTag(8);
output.WriteInt32(ApplicationId);
}
if (ApplicationInstanceId != 0) {
output.WriteRawTag(16);
output.WriteInt32(ApplicationInstanceId);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (ApplicationId != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(ApplicationId);
}
if (ApplicationInstanceId != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(ApplicationInstanceId);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(ApplicationInstanceMapping other) {
if (other == null) {
return;
}
if (other.ApplicationId != 0) {
ApplicationId = other.ApplicationId;
}
if (other.ApplicationInstanceId != 0) {
ApplicationInstanceId = other.ApplicationInstanceId;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
ApplicationId = input.ReadInt32();
break;
}
case 16: {
ApplicationInstanceId = input.ReadInt32();
break;
}
}
}
}
}
public sealed partial class ApplicationInstanceRecover : pb::IMessage<ApplicationInstanceRecover> {
private static readonly pb::MessageParser<ApplicationInstanceRecover> _parser = new pb::MessageParser<ApplicationInstanceRecover>(() => new ApplicationInstanceRecover());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ApplicationInstanceRecover> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::SkyWalking.NetworkProtocol.DiscoveryServiceReflection.Descriptor.MessageTypes[2]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ApplicationInstanceRecover() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ApplicationInstanceRecover(ApplicationInstanceRecover other) : this() {
applicationId_ = other.applicationId_;
applicationInstanceId_ = other.applicationInstanceId_;
registerTime_ = other.registerTime_;
osinfo_ = other.osinfo_ != null ? other.osinfo_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ApplicationInstanceRecover Clone() {
return new ApplicationInstanceRecover(this);
}
/// <summary>Field number for the "applicationId" field.</summary>
public const int ApplicationIdFieldNumber = 1;
private int applicationId_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int ApplicationId {
get { return applicationId_; }
set {
applicationId_ = value;
}
}
/// <summary>Field number for the "applicationInstanceId" field.</summary>
public const int ApplicationInstanceIdFieldNumber = 2;
private int applicationInstanceId_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int ApplicationInstanceId {
get { return applicationInstanceId_; }
set {
applicationInstanceId_ = value;
}
}
/// <summary>Field number for the "registerTime" field.</summary>
public const int RegisterTimeFieldNumber = 3;
private long registerTime_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long RegisterTime {
get { return registerTime_; }
set {
registerTime_ = value;
}
}
/// <summary>Field number for the "osinfo" field.</summary>
public const int OsinfoFieldNumber = 4;
private global::SkyWalking.NetworkProtocol.OSInfo osinfo_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::SkyWalking.NetworkProtocol.OSInfo Osinfo {
get { return osinfo_; }
set {
osinfo_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as ApplicationInstanceRecover);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(ApplicationInstanceRecover other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (ApplicationId != other.ApplicationId) return false;
if (ApplicationInstanceId != other.ApplicationInstanceId) return false;
if (RegisterTime != other.RegisterTime) return false;
if (!object.Equals(Osinfo, other.Osinfo)) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (ApplicationId != 0) hash ^= ApplicationId.GetHashCode();
if (ApplicationInstanceId != 0) hash ^= ApplicationInstanceId.GetHashCode();
if (RegisterTime != 0L) hash ^= RegisterTime.GetHashCode();
if (osinfo_ != null) hash ^= Osinfo.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (ApplicationId != 0) {
output.WriteRawTag(8);
output.WriteInt32(ApplicationId);
}
if (ApplicationInstanceId != 0) {
output.WriteRawTag(16);
output.WriteInt32(ApplicationInstanceId);
}
if (RegisterTime != 0L) {
output.WriteRawTag(24);
output.WriteInt64(RegisterTime);
}
if (osinfo_ != null) {
output.WriteRawTag(34);
output.WriteMessage(Osinfo);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (ApplicationId != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(ApplicationId);
}
if (ApplicationInstanceId != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(ApplicationInstanceId);
}
if (RegisterTime != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(RegisterTime);
}
if (osinfo_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Osinfo);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(ApplicationInstanceRecover other) {
if (other == null) {
return;
}
if (other.ApplicationId != 0) {
ApplicationId = other.ApplicationId;
}
if (other.ApplicationInstanceId != 0) {
ApplicationInstanceId = other.ApplicationInstanceId;
}
if (other.RegisterTime != 0L) {
RegisterTime = other.RegisterTime;
}
if (other.osinfo_ != null) {
if (osinfo_ == null) {
osinfo_ = new global::SkyWalking.NetworkProtocol.OSInfo();
}
Osinfo.MergeFrom(other.Osinfo);
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
ApplicationId = input.ReadInt32();
break;
}
case 16: {
ApplicationInstanceId = input.ReadInt32();
break;
}
case 24: {
RegisterTime = input.ReadInt64();
break;
}
case 34: {
if (osinfo_ == null) {
osinfo_ = new global::SkyWalking.NetworkProtocol.OSInfo();
}
input.ReadMessage(osinfo_);
break;
}
}
}
}
}
public sealed partial class ApplicationInstanceHeartbeat : pb::IMessage<ApplicationInstanceHeartbeat> {
private static readonly pb::MessageParser<ApplicationInstanceHeartbeat> _parser = new pb::MessageParser<ApplicationInstanceHeartbeat>(() => new ApplicationInstanceHeartbeat());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ApplicationInstanceHeartbeat> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::SkyWalking.NetworkProtocol.DiscoveryServiceReflection.Descriptor.MessageTypes[3]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ApplicationInstanceHeartbeat() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ApplicationInstanceHeartbeat(ApplicationInstanceHeartbeat other) : this() {
applicationInstanceId_ = other.applicationInstanceId_;
heartbeatTime_ = other.heartbeatTime_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ApplicationInstanceHeartbeat Clone() {
return new ApplicationInstanceHeartbeat(this);
}
/// <summary>Field number for the "applicationInstanceId" field.</summary>
public const int ApplicationInstanceIdFieldNumber = 1;
private int applicationInstanceId_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int ApplicationInstanceId {
get { return applicationInstanceId_; }
set {
applicationInstanceId_ = value;
}
}
/// <summary>Field number for the "heartbeatTime" field.</summary>
public const int HeartbeatTimeFieldNumber = 2;
private long heartbeatTime_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long HeartbeatTime {
get { return heartbeatTime_; }
set {
heartbeatTime_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as ApplicationInstanceHeartbeat);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(ApplicationInstanceHeartbeat other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (ApplicationInstanceId != other.ApplicationInstanceId) return false;
if (HeartbeatTime != other.HeartbeatTime) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (ApplicationInstanceId != 0) hash ^= ApplicationInstanceId.GetHashCode();
if (HeartbeatTime != 0L) hash ^= HeartbeatTime.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (ApplicationInstanceId != 0) {
output.WriteRawTag(8);
output.WriteInt32(ApplicationInstanceId);
}
if (HeartbeatTime != 0L) {
output.WriteRawTag(16);
output.WriteInt64(HeartbeatTime);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (ApplicationInstanceId != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(ApplicationInstanceId);
}
if (HeartbeatTime != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(HeartbeatTime);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(ApplicationInstanceHeartbeat other) {
if (other == null) {
return;
}
if (other.ApplicationInstanceId != 0) {
ApplicationInstanceId = other.ApplicationInstanceId;
}
if (other.HeartbeatTime != 0L) {
HeartbeatTime = other.HeartbeatTime;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
ApplicationInstanceId = input.ReadInt32();
break;
}
case 16: {
HeartbeatTime = input.ReadInt64();
break;
}
}
}
}
}
public sealed partial class OSInfo : pb::IMessage<OSInfo> {
private static readonly pb::MessageParser<OSInfo> _parser = new pb::MessageParser<OSInfo>(() => new OSInfo());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<OSInfo> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::SkyWalking.NetworkProtocol.DiscoveryServiceReflection.Descriptor.MessageTypes[4]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public OSInfo() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public OSInfo(OSInfo other) : this() {
osName_ = other.osName_;
hostname_ = other.hostname_;
processNo_ = other.processNo_;
ipv4S_ = other.ipv4S_.Clone();
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public OSInfo Clone() {
return new OSInfo(this);
}
/// <summary>Field number for the "osName" field.</summary>
public const int OsNameFieldNumber = 1;
private string osName_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string OsName {
get { return osName_; }
set {
osName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "hostname" field.</summary>
public const int HostnameFieldNumber = 2;
private string hostname_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Hostname {
get { return hostname_; }
set {
hostname_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "processNo" field.</summary>
public const int ProcessNoFieldNumber = 3;
private int processNo_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int ProcessNo {
get { return processNo_; }
set {
processNo_ = value;
}
}
/// <summary>Field number for the "ipv4s" field.</summary>
public const int Ipv4SFieldNumber = 4;
private static readonly pb::FieldCodec<string> _repeated_ipv4S_codec
= pb::FieldCodec.ForString(34);
private readonly pbc::RepeatedField<string> ipv4S_ = new pbc::RepeatedField<string>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<string> Ipv4S {
get { return ipv4S_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as OSInfo);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(OSInfo other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (OsName != other.OsName) return false;
if (Hostname != other.Hostname) return false;
if (ProcessNo != other.ProcessNo) return false;
if(!ipv4S_.Equals(other.ipv4S_)) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (OsName.Length != 0) hash ^= OsName.GetHashCode();
if (Hostname.Length != 0) hash ^= Hostname.GetHashCode();
if (ProcessNo != 0) hash ^= ProcessNo.GetHashCode();
hash ^= ipv4S_.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (OsName.Length != 0) {
output.WriteRawTag(10);
output.WriteString(OsName);
}
if (Hostname.Length != 0) {
output.WriteRawTag(18);
output.WriteString(Hostname);
}
if (ProcessNo != 0) {
output.WriteRawTag(24);
output.WriteInt32(ProcessNo);
}
ipv4S_.WriteTo(output, _repeated_ipv4S_codec);
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (OsName.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(OsName);
}
if (Hostname.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Hostname);
}
if (ProcessNo != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(ProcessNo);
}
size += ipv4S_.CalculateSize(_repeated_ipv4S_codec);
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(OSInfo other) {
if (other == null) {
return;
}
if (other.OsName.Length != 0) {
OsName = other.OsName;
}
if (other.Hostname.Length != 0) {
Hostname = other.Hostname;
}
if (other.ProcessNo != 0) {
ProcessNo = other.ProcessNo;
}
ipv4S_.Add(other.ipv4S_);
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
OsName = input.ReadString();
break;
}
case 18: {
Hostname = input.ReadString();
break;
}
case 24: {
ProcessNo = input.ReadInt32();
break;
}
case 34: {
ipv4S_.AddEntriesFrom(input, _repeated_ipv4S_codec);
break;
}
}
}
}
}
public sealed partial class ServiceNameCollection : pb::IMessage<ServiceNameCollection> {
private static readonly pb::MessageParser<ServiceNameCollection> _parser = new pb::MessageParser<ServiceNameCollection>(() => new ServiceNameCollection());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ServiceNameCollection> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::SkyWalking.NetworkProtocol.DiscoveryServiceReflection.Descriptor.MessageTypes[5]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ServiceNameCollection() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ServiceNameCollection(ServiceNameCollection other) : this() {
elements_ = other.elements_.Clone();
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ServiceNameCollection Clone() {
return new ServiceNameCollection(this);
}
/// <summary>Field number for the "elements" field.</summary>
public const int ElementsFieldNumber = 1;
private static readonly pb::FieldCodec<global::SkyWalking.NetworkProtocol.ServiceNameElement> _repeated_elements_codec
= pb::FieldCodec.ForMessage(10, global::SkyWalking.NetworkProtocol.ServiceNameElement.Parser);
private readonly pbc::RepeatedField<global::SkyWalking.NetworkProtocol.ServiceNameElement> elements_ = new pbc::RepeatedField<global::SkyWalking.NetworkProtocol.ServiceNameElement>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::SkyWalking.NetworkProtocol.ServiceNameElement> Elements {
get { return elements_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as ServiceNameCollection);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(ServiceNameCollection other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if(!elements_.Equals(other.elements_)) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= elements_.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
elements_.WriteTo(output, _repeated_elements_codec);
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += elements_.CalculateSize(_repeated_elements_codec);
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(ServiceNameCollection other) {
if (other == null) {
return;
}
elements_.Add(other.elements_);
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
elements_.AddEntriesFrom(input, _repeated_elements_codec);
break;
}
}
}
}
}
public sealed partial class ServiceNameMappingCollection : pb::IMessage<ServiceNameMappingCollection> {
private static readonly pb::MessageParser<ServiceNameMappingCollection> _parser = new pb::MessageParser<ServiceNameMappingCollection>(() => new ServiceNameMappingCollection());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ServiceNameMappingCollection> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::SkyWalking.NetworkProtocol.DiscoveryServiceReflection.Descriptor.MessageTypes[6]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ServiceNameMappingCollection() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ServiceNameMappingCollection(ServiceNameMappingCollection other) : this() {
elements_ = other.elements_.Clone();
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ServiceNameMappingCollection Clone() {
return new ServiceNameMappingCollection(this);
}
/// <summary>Field number for the "elements" field.</summary>
public const int ElementsFieldNumber = 1;
private static readonly pb::FieldCodec<global::SkyWalking.NetworkProtocol.ServiceNameMappingElement> _repeated_elements_codec
= pb::FieldCodec.ForMessage(10, global::SkyWalking.NetworkProtocol.ServiceNameMappingElement.Parser);
private readonly pbc::RepeatedField<global::SkyWalking.NetworkProtocol.ServiceNameMappingElement> elements_ = new pbc::RepeatedField<global::SkyWalking.NetworkProtocol.ServiceNameMappingElement>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::SkyWalking.NetworkProtocol.ServiceNameMappingElement> Elements {
get { return elements_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as ServiceNameMappingCollection);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(ServiceNameMappingCollection other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if(!elements_.Equals(other.elements_)) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= elements_.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
elements_.WriteTo(output, _repeated_elements_codec);
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += elements_.CalculateSize(_repeated_elements_codec);
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(ServiceNameMappingCollection other) {
if (other == null) {
return;
}
elements_.Add(other.elements_);
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
elements_.AddEntriesFrom(input, _repeated_elements_codec);
break;
}
}
}
}
}
public sealed partial class ServiceNameMappingElement : pb::IMessage<ServiceNameMappingElement> {
private static readonly pb::MessageParser<ServiceNameMappingElement> _parser = new pb::MessageParser<ServiceNameMappingElement>(() => new ServiceNameMappingElement());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ServiceNameMappingElement> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::SkyWalking.NetworkProtocol.DiscoveryServiceReflection.Descriptor.MessageTypes[7]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ServiceNameMappingElement() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ServiceNameMappingElement(ServiceNameMappingElement other) : this() {
serviceId_ = other.serviceId_;
element_ = other.element_ != null ? other.element_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ServiceNameMappingElement Clone() {
return new ServiceNameMappingElement(this);
}
/// <summary>Field number for the "serviceId" field.</summary>
public const int ServiceIdFieldNumber = 1;
private int serviceId_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int ServiceId {
get { return serviceId_; }
set {
serviceId_ = value;
}
}
/// <summary>Field number for the "element" field.</summary>
public const int ElementFieldNumber = 2;
private global::SkyWalking.NetworkProtocol.ServiceNameElement element_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::SkyWalking.NetworkProtocol.ServiceNameElement Element {
get { return element_; }
set {
element_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as ServiceNameMappingElement);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(ServiceNameMappingElement other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (ServiceId != other.ServiceId) return false;
if (!object.Equals(Element, other.Element)) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (ServiceId != 0) hash ^= ServiceId.GetHashCode();
if (element_ != null) hash ^= Element.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (ServiceId != 0) {
output.WriteRawTag(8);
output.WriteInt32(ServiceId);
}
if (element_ != null) {
output.WriteRawTag(18);
output.WriteMessage(Element);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (ServiceId != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(ServiceId);
}
if (element_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Element);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(ServiceNameMappingElement other) {
if (other == null) {
return;
}
if (other.ServiceId != 0) {
ServiceId = other.ServiceId;
}
if (other.element_ != null) {
if (element_ == null) {
element_ = new global::SkyWalking.NetworkProtocol.ServiceNameElement();
}
Element.MergeFrom(other.Element);
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
ServiceId = input.ReadInt32();
break;
}
case 18: {
if (element_ == null) {
element_ = new global::SkyWalking.NetworkProtocol.ServiceNameElement();
}
input.ReadMessage(element_);
break;
}
}
}
}
}
public sealed partial class ServiceNameElement : pb::IMessage<ServiceNameElement> {
private static readonly pb::MessageParser<ServiceNameElement> _parser = new pb::MessageParser<ServiceNameElement>(() => new ServiceNameElement());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ServiceNameElement> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::SkyWalking.NetworkProtocol.DiscoveryServiceReflection.Descriptor.MessageTypes[8]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ServiceNameElement() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ServiceNameElement(ServiceNameElement other) : this() {
serviceName_ = other.serviceName_;
applicationId_ = other.applicationId_;
srcSpanType_ = other.srcSpanType_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ServiceNameElement Clone() {
return new ServiceNameElement(this);
}
/// <summary>Field number for the "serviceName" field.</summary>
public const int ServiceNameFieldNumber = 1;
private string serviceName_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string ServiceName {
get { return serviceName_; }
set {
serviceName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "applicationId" field.</summary>
public const int ApplicationIdFieldNumber = 2;
private int applicationId_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int ApplicationId {
get { return applicationId_; }
set {
applicationId_ = value;
}
}
/// <summary>Field number for the "srcSpanType" field.</summary>
public const int SrcSpanTypeFieldNumber = 3;
private global::SkyWalking.NetworkProtocol.SpanType srcSpanType_ = 0;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::SkyWalking.NetworkProtocol.SpanType SrcSpanType {
get { return srcSpanType_; }
set {
srcSpanType_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as ServiceNameElement);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(ServiceNameElement other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (ServiceName != other.ServiceName) return false;
if (ApplicationId != other.ApplicationId) return false;
if (SrcSpanType != other.SrcSpanType) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (ServiceName.Length != 0) hash ^= ServiceName.GetHashCode();
if (ApplicationId != 0) hash ^= ApplicationId.GetHashCode();
if (SrcSpanType != 0) hash ^= SrcSpanType.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (ServiceName.Length != 0) {
output.WriteRawTag(10);
output.WriteString(ServiceName);
}
if (ApplicationId != 0) {
output.WriteRawTag(16);
output.WriteInt32(ApplicationId);
}
if (SrcSpanType != 0) {
output.WriteRawTag(24);
output.WriteEnum((int) SrcSpanType);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (ServiceName.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(ServiceName);
}
if (ApplicationId != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(ApplicationId);
}
if (SrcSpanType != 0) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) SrcSpanType);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(ServiceNameElement other) {
if (other == null) {
return;
}
if (other.ServiceName.Length != 0) {
ServiceName = other.ServiceName;
}
if (other.ApplicationId != 0) {
ApplicationId = other.ApplicationId;
}
if (other.SrcSpanType != 0) {
SrcSpanType = other.SrcSpanType;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
ServiceName = input.ReadString();
break;
}
case 16: {
ApplicationId = input.ReadInt32();
break;
}
case 24: {
srcSpanType_ = (global::SkyWalking.NetworkProtocol.SpanType) input.ReadEnum();
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: DiscoveryService.proto
// </auto-generated>
#pragma warning disable 0414, 1591
#region Designer generated code
using grpc = global::Grpc.Core;
namespace SkyWalking.NetworkProtocol {
public static partial class InstanceDiscoveryService
{
static readonly string __ServiceName = "InstanceDiscoveryService";
static readonly grpc::Marshaller<global::SkyWalking.NetworkProtocol.ApplicationInstance> __Marshaller_ApplicationInstance = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::SkyWalking.NetworkProtocol.ApplicationInstance.Parser.ParseFrom);
static readonly grpc::Marshaller<global::SkyWalking.NetworkProtocol.ApplicationInstanceMapping> __Marshaller_ApplicationInstanceMapping = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::SkyWalking.NetworkProtocol.ApplicationInstanceMapping.Parser.ParseFrom);
static readonly grpc::Marshaller<global::SkyWalking.NetworkProtocol.ApplicationInstanceHeartbeat> __Marshaller_ApplicationInstanceHeartbeat = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::SkyWalking.NetworkProtocol.ApplicationInstanceHeartbeat.Parser.ParseFrom);
static readonly grpc::Marshaller<global::SkyWalking.NetworkProtocol.Downstream> __Marshaller_Downstream = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::SkyWalking.NetworkProtocol.Downstream.Parser.ParseFrom);
static readonly grpc::Method<global::SkyWalking.NetworkProtocol.ApplicationInstance, global::SkyWalking.NetworkProtocol.ApplicationInstanceMapping> __Method_registerInstance = new grpc::Method<global::SkyWalking.NetworkProtocol.ApplicationInstance, global::SkyWalking.NetworkProtocol.ApplicationInstanceMapping>(
grpc::MethodType.Unary,
__ServiceName,
"registerInstance",
__Marshaller_ApplicationInstance,
__Marshaller_ApplicationInstanceMapping);
static readonly grpc::Method<global::SkyWalking.NetworkProtocol.ApplicationInstanceHeartbeat, global::SkyWalking.NetworkProtocol.Downstream> __Method_heartbeat = new grpc::Method<global::SkyWalking.NetworkProtocol.ApplicationInstanceHeartbeat, global::SkyWalking.NetworkProtocol.Downstream>(
grpc::MethodType.Unary,
__ServiceName,
"heartbeat",
__Marshaller_ApplicationInstanceHeartbeat,
__Marshaller_Downstream);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
{
get { return global::SkyWalking.NetworkProtocol.DiscoveryServiceReflection.Descriptor.Services[0]; }
}
/// <summary>Base class for server-side implementations of InstanceDiscoveryService</summary>
public abstract partial class InstanceDiscoveryServiceBase
{
public virtual global::System.Threading.Tasks.Task<global::SkyWalking.NetworkProtocol.ApplicationInstanceMapping> registerInstance(global::SkyWalking.NetworkProtocol.ApplicationInstance request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
public virtual global::System.Threading.Tasks.Task<global::SkyWalking.NetworkProtocol.Downstream> heartbeat(global::SkyWalking.NetworkProtocol.ApplicationInstanceHeartbeat request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
}
/// <summary>Client for InstanceDiscoveryService</summary>
public partial class InstanceDiscoveryServiceClient : grpc::ClientBase<InstanceDiscoveryServiceClient>
{
/// <summary>Creates a new client for InstanceDiscoveryService</summary>
/// <param name="channel">The channel to use to make remote calls.</param>
public InstanceDiscoveryServiceClient(grpc::Channel channel) : base(channel)
{
}
/// <summary>Creates a new client for InstanceDiscoveryService that uses a custom <c>CallInvoker</c>.</summary>
/// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
public InstanceDiscoveryServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker)
{
}
/// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
protected InstanceDiscoveryServiceClient() : base()
{
}
/// <summary>Protected constructor to allow creation of configured clients.</summary>
/// <param name="configuration">The client configuration.</param>
protected InstanceDiscoveryServiceClient(ClientBaseConfiguration configuration) : base(configuration)
{
}
public virtual global::SkyWalking.NetworkProtocol.ApplicationInstanceMapping registerInstance(global::SkyWalking.NetworkProtocol.ApplicationInstance request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return registerInstance(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
public virtual global::SkyWalking.NetworkProtocol.ApplicationInstanceMapping registerInstance(global::SkyWalking.NetworkProtocol.ApplicationInstance request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_registerInstance, null, options, request);
}
public virtual grpc::AsyncUnaryCall<global::SkyWalking.NetworkProtocol.ApplicationInstanceMapping> registerInstanceAsync(global::SkyWalking.NetworkProtocol.ApplicationInstance request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return registerInstanceAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
public virtual grpc::AsyncUnaryCall<global::SkyWalking.NetworkProtocol.ApplicationInstanceMapping> registerInstanceAsync(global::SkyWalking.NetworkProtocol.ApplicationInstance request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_registerInstance, null, options, request);
}
public virtual global::SkyWalking.NetworkProtocol.Downstream heartbeat(global::SkyWalking.NetworkProtocol.ApplicationInstanceHeartbeat request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return heartbeat(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
public virtual global::SkyWalking.NetworkProtocol.Downstream heartbeat(global::SkyWalking.NetworkProtocol.ApplicationInstanceHeartbeat request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_heartbeat, null, options, request);
}
public virtual grpc::AsyncUnaryCall<global::SkyWalking.NetworkProtocol.Downstream> heartbeatAsync(global::SkyWalking.NetworkProtocol.ApplicationInstanceHeartbeat request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return heartbeatAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
public virtual grpc::AsyncUnaryCall<global::SkyWalking.NetworkProtocol.Downstream> heartbeatAsync(global::SkyWalking.NetworkProtocol.ApplicationInstanceHeartbeat request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_heartbeat, null, options, request);
}
/// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
protected override InstanceDiscoveryServiceClient NewInstance(ClientBaseConfiguration configuration)
{
return new InstanceDiscoveryServiceClient(configuration);
}
}
/// <summary>Creates service definition that can be registered with a server</summary>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static grpc::ServerServiceDefinition BindService(InstanceDiscoveryServiceBase serviceImpl)
{
return grpc::ServerServiceDefinition.CreateBuilder()
.AddMethod(__Method_registerInstance, serviceImpl.registerInstance)
.AddMethod(__Method_heartbeat, serviceImpl.heartbeat).Build();
}
}
/// <summary>
///discovery service for ServiceName by Network address or application code
/// </summary>
public static partial class ServiceNameDiscoveryService
{
static readonly string __ServiceName = "ServiceNameDiscoveryService";
static readonly grpc::Marshaller<global::SkyWalking.NetworkProtocol.ServiceNameCollection> __Marshaller_ServiceNameCollection = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::SkyWalking.NetworkProtocol.ServiceNameCollection.Parser.ParseFrom);
static readonly grpc::Marshaller<global::SkyWalking.NetworkProtocol.ServiceNameMappingCollection> __Marshaller_ServiceNameMappingCollection = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::SkyWalking.NetworkProtocol.ServiceNameMappingCollection.Parser.ParseFrom);
static readonly grpc::Method<global::SkyWalking.NetworkProtocol.ServiceNameCollection, global::SkyWalking.NetworkProtocol.ServiceNameMappingCollection> __Method_discovery = new grpc::Method<global::SkyWalking.NetworkProtocol.ServiceNameCollection, global::SkyWalking.NetworkProtocol.ServiceNameMappingCollection>(
grpc::MethodType.Unary,
__ServiceName,
"discovery",
__Marshaller_ServiceNameCollection,
__Marshaller_ServiceNameMappingCollection);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
{
get { return global::SkyWalking.NetworkProtocol.DiscoveryServiceReflection.Descriptor.Services[1]; }
}
/// <summary>Base class for server-side implementations of ServiceNameDiscoveryService</summary>
public abstract partial class ServiceNameDiscoveryServiceBase
{
public virtual global::System.Threading.Tasks.Task<global::SkyWalking.NetworkProtocol.ServiceNameMappingCollection> discovery(global::SkyWalking.NetworkProtocol.ServiceNameCollection request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
}
/// <summary>Client for ServiceNameDiscoveryService</summary>
public partial class ServiceNameDiscoveryServiceClient : grpc::ClientBase<ServiceNameDiscoveryServiceClient>
{
/// <summary>Creates a new client for ServiceNameDiscoveryService</summary>
/// <param name="channel">The channel to use to make remote calls.</param>
public ServiceNameDiscoveryServiceClient(grpc::Channel channel) : base(channel)
{
}
/// <summary>Creates a new client for ServiceNameDiscoveryService that uses a custom <c>CallInvoker</c>.</summary>
/// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
public ServiceNameDiscoveryServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker)
{
}
/// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
protected ServiceNameDiscoveryServiceClient() : base()
{
}
/// <summary>Protected constructor to allow creation of configured clients.</summary>
/// <param name="configuration">The client configuration.</param>
protected ServiceNameDiscoveryServiceClient(ClientBaseConfiguration configuration) : base(configuration)
{
}
public virtual global::SkyWalking.NetworkProtocol.ServiceNameMappingCollection discovery(global::SkyWalking.NetworkProtocol.ServiceNameCollection request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return discovery(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
public virtual global::SkyWalking.NetworkProtocol.ServiceNameMappingCollection discovery(global::SkyWalking.NetworkProtocol.ServiceNameCollection request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_discovery, null, options, request);
}
public virtual grpc::AsyncUnaryCall<global::SkyWalking.NetworkProtocol.ServiceNameMappingCollection> discoveryAsync(global::SkyWalking.NetworkProtocol.ServiceNameCollection request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return discoveryAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
public virtual grpc::AsyncUnaryCall<global::SkyWalking.NetworkProtocol.ServiceNameMappingCollection> discoveryAsync(global::SkyWalking.NetworkProtocol.ServiceNameCollection request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_discovery, null, options, request);
}
/// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
protected override ServiceNameDiscoveryServiceClient NewInstance(ClientBaseConfiguration configuration)
{
return new ServiceNameDiscoveryServiceClient(configuration);
}
}
/// <summary>Creates service definition that can be registered with a server</summary>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static grpc::ServerServiceDefinition BindService(ServiceNameDiscoveryServiceBase serviceImpl)
{
return grpc::ServerServiceDefinition.CreateBuilder()
.AddMethod(__Method_discovery, serviceImpl.discovery).Build();
}
}
}
#endregion
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: Downstream.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace SkyWalking.NetworkProtocol {
/// <summary>Holder for reflection information generated from Downstream.proto</summary>
public static partial class DownstreamReflection {
#region Descriptor
/// <summary>File descriptor for Downstream.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static DownstreamReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"ChBEb3duc3RyZWFtLnByb3RvIgwKCkRvd25zdHJlYW1CSAonb3JnLmFwYWNo",
"ZS5za3l3YWxraW5nLmFwbS5uZXR3b3JrLnByb3RvUAGqAhpTa3lXYWxraW5n",
"Lk5ldHdvcmtQcm90b2NvbGIGcHJvdG8z"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::SkyWalking.NetworkProtocol.Downstream), global::SkyWalking.NetworkProtocol.Downstream.Parser, null, null, null, null)
}));
}
#endregion
}
#region Messages
/// <summary>
/// nothing down stream from collector yet.
/// </summary>
public sealed partial class Downstream : pb::IMessage<Downstream> {
private static readonly pb::MessageParser<Downstream> _parser = new pb::MessageParser<Downstream>(() => new Downstream());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Downstream> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::SkyWalking.NetworkProtocol.DownstreamReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Downstream() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Downstream(Downstream other) : this() {
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Downstream Clone() {
return new Downstream(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as Downstream);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(Downstream other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(Downstream other) {
if (other == null) {
return;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
}
}
}
}
#endregion
}
#endregion Designer generated code
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: JVMMetricsService.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace SkyWalking.NetworkProtocol {
/// <summary>Holder for reflection information generated from JVMMetricsService.proto</summary>
public static partial class JVMMetricsServiceReflection {
#region Descriptor
/// <summary>File descriptor for JVMMetricsService.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static JVMMetricsServiceReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"ChdKVk1NZXRyaWNzU2VydmljZS5wcm90bxoQRG93bnN0cmVhbS5wcm90byJI",
"CgpKVk1NZXRyaWNzEhsKB21ldHJpY3MYASADKAsyCi5KVk1NZXRyaWMSHQoV",
"YXBwbGljYXRpb25JbnN0YW5jZUlkGAIgASgFIncKCUpWTU1ldHJpYxIMCgR0",
"aW1lGAEgASgDEhEKA2NwdRgCIAEoCzIELkNQVRIXCgZtZW1vcnkYAyADKAsy",
"By5NZW1vcnkSHwoKbWVtb3J5UG9vbBgEIAMoCzILLk1lbW9yeVBvb2wSDwoC",
"Z2MYBSADKAsyAy5HQyIbCgNDUFUSFAoMdXNhZ2VQZXJjZW50GAIgASgBIlQK",
"Bk1lbW9yeRIOCgZpc0hlYXAYASABKAgSDAoEaW5pdBgCIAEoAxILCgNtYXgY",
"AyABKAMSDAoEdXNlZBgEIAEoAxIRCgljb21taXR0ZWQYBSABKAMiYAoKTWVt",
"b3J5UG9vbBIXCgR0eXBlGAEgASgOMgkuUG9vbFR5cGUSDAoEaW5pdBgCIAEo",
"AxILCgNtYXgYAyABKAMSDAoEdXNlZBgEIAEoAxIQCghjb21taXRlZBgFIAEo",
"AyI8CgJHQxIZCgZwaHJhc2UYASABKA4yCS5HQ1BocmFzZRINCgVjb3VudBgC",
"IAEoAxIMCgR0aW1lGAMgASgDKoABCghQb29sVHlwZRIUChBDT0RFX0NBQ0hF",
"X1VTQUdFEAASEAoMTkVXR0VOX1VTQUdFEAESEAoMT0xER0VOX1VTQUdFEAIS",
"EgoOU1VSVklWT1JfVVNBR0UQAxIRCg1QRVJNR0VOX1VTQUdFEAQSEwoPTUVU",
"QVNQQUNFX1VTQUdFEAUqHAoIR0NQaHJhc2USBwoDTkVXEAASBwoDT0xEEAEy",
"OgoRSlZNTWV0cmljc1NlcnZpY2USJQoHY29sbGVjdBILLkpWTU1ldHJpY3Ma",
"Cy5Eb3duc3RyZWFtIgBCSAonb3JnLmFwYWNoZS5za3l3YWxraW5nLmFwbS5u",
"ZXR3b3JrLnByb3RvUAGqAhpTa3lXYWxraW5nLk5ldHdvcmtQcm90b2NvbGIG",
"cHJvdG8z"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::SkyWalking.NetworkProtocol.DownstreamReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(new[] {typeof(global::SkyWalking.NetworkProtocol.PoolType), typeof(global::SkyWalking.NetworkProtocol.GCPhrase), }, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::SkyWalking.NetworkProtocol.JVMMetrics), global::SkyWalking.NetworkProtocol.JVMMetrics.Parser, new[]{ "Metrics", "ApplicationInstanceId" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::SkyWalking.NetworkProtocol.JVMMetric), global::SkyWalking.NetworkProtocol.JVMMetric.Parser, new[]{ "Time", "Cpu", "Memory", "MemoryPool", "Gc" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::SkyWalking.NetworkProtocol.CPU), global::SkyWalking.NetworkProtocol.CPU.Parser, new[]{ "UsagePercent" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::SkyWalking.NetworkProtocol.Memory), global::SkyWalking.NetworkProtocol.Memory.Parser, new[]{ "IsHeap", "Init", "Max", "Used", "Committed" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::SkyWalking.NetworkProtocol.MemoryPool), global::SkyWalking.NetworkProtocol.MemoryPool.Parser, new[]{ "Type", "Init", "Max", "Used", "Commited" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::SkyWalking.NetworkProtocol.GC), global::SkyWalking.NetworkProtocol.GC.Parser, new[]{ "Phrase", "Count", "Time" }, null, null, null)
}));
}
#endregion
}
#region Enums
public enum PoolType {
[pbr::OriginalName("CODE_CACHE_USAGE")] CodeCacheUsage = 0,
[pbr::OriginalName("NEWGEN_USAGE")] NewgenUsage = 1,
[pbr::OriginalName("OLDGEN_USAGE")] OldgenUsage = 2,
[pbr::OriginalName("SURVIVOR_USAGE")] SurvivorUsage = 3,
[pbr::OriginalName("PERMGEN_USAGE")] PermgenUsage = 4,
[pbr::OriginalName("METASPACE_USAGE")] MetaspaceUsage = 5,
}
public enum GCPhrase {
[pbr::OriginalName("NEW")] New = 0,
[pbr::OriginalName("OLD")] Old = 1,
}
#endregion
#region Messages
public sealed partial class JVMMetrics : pb::IMessage<JVMMetrics> {
private static readonly pb::MessageParser<JVMMetrics> _parser = new pb::MessageParser<JVMMetrics>(() => new JVMMetrics());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<JVMMetrics> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::SkyWalking.NetworkProtocol.JVMMetricsServiceReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public JVMMetrics() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public JVMMetrics(JVMMetrics other) : this() {
metrics_ = other.metrics_.Clone();
applicationInstanceId_ = other.applicationInstanceId_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public JVMMetrics Clone() {
return new JVMMetrics(this);
}
/// <summary>Field number for the "metrics" field.</summary>
public const int MetricsFieldNumber = 1;
private static readonly pb::FieldCodec<global::SkyWalking.NetworkProtocol.JVMMetric> _repeated_metrics_codec
= pb::FieldCodec.ForMessage(10, global::SkyWalking.NetworkProtocol.JVMMetric.Parser);
private readonly pbc::RepeatedField<global::SkyWalking.NetworkProtocol.JVMMetric> metrics_ = new pbc::RepeatedField<global::SkyWalking.NetworkProtocol.JVMMetric>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::SkyWalking.NetworkProtocol.JVMMetric> Metrics {
get { return metrics_; }
}
/// <summary>Field number for the "applicationInstanceId" field.</summary>
public const int ApplicationInstanceIdFieldNumber = 2;
private int applicationInstanceId_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int ApplicationInstanceId {
get { return applicationInstanceId_; }
set {
applicationInstanceId_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as JVMMetrics);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(JVMMetrics other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if(!metrics_.Equals(other.metrics_)) return false;
if (ApplicationInstanceId != other.ApplicationInstanceId) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= metrics_.GetHashCode();
if (ApplicationInstanceId != 0) hash ^= ApplicationInstanceId.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
metrics_.WriteTo(output, _repeated_metrics_codec);
if (ApplicationInstanceId != 0) {
output.WriteRawTag(16);
output.WriteInt32(ApplicationInstanceId);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += metrics_.CalculateSize(_repeated_metrics_codec);
if (ApplicationInstanceId != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(ApplicationInstanceId);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(JVMMetrics other) {
if (other == null) {
return;
}
metrics_.Add(other.metrics_);
if (other.ApplicationInstanceId != 0) {
ApplicationInstanceId = other.ApplicationInstanceId;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
metrics_.AddEntriesFrom(input, _repeated_metrics_codec);
break;
}
case 16: {
ApplicationInstanceId = input.ReadInt32();
break;
}
}
}
}
}
public sealed partial class JVMMetric : pb::IMessage<JVMMetric> {
private static readonly pb::MessageParser<JVMMetric> _parser = new pb::MessageParser<JVMMetric>(() => new JVMMetric());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<JVMMetric> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::SkyWalking.NetworkProtocol.JVMMetricsServiceReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public JVMMetric() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public JVMMetric(JVMMetric other) : this() {
time_ = other.time_;
cpu_ = other.cpu_ != null ? other.cpu_.Clone() : null;
memory_ = other.memory_.Clone();
memoryPool_ = other.memoryPool_.Clone();
gc_ = other.gc_.Clone();
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public JVMMetric Clone() {
return new JVMMetric(this);
}
/// <summary>Field number for the "time" field.</summary>
public const int TimeFieldNumber = 1;
private long time_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long Time {
get { return time_; }
set {
time_ = value;
}
}
/// <summary>Field number for the "cpu" field.</summary>
public const int CpuFieldNumber = 2;
private global::SkyWalking.NetworkProtocol.CPU cpu_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::SkyWalking.NetworkProtocol.CPU Cpu {
get { return cpu_; }
set {
cpu_ = value;
}
}
/// <summary>Field number for the "memory" field.</summary>
public const int MemoryFieldNumber = 3;
private static readonly pb::FieldCodec<global::SkyWalking.NetworkProtocol.Memory> _repeated_memory_codec
= pb::FieldCodec.ForMessage(26, global::SkyWalking.NetworkProtocol.Memory.Parser);
private readonly pbc::RepeatedField<global::SkyWalking.NetworkProtocol.Memory> memory_ = new pbc::RepeatedField<global::SkyWalking.NetworkProtocol.Memory>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::SkyWalking.NetworkProtocol.Memory> Memory {
get { return memory_; }
}
/// <summary>Field number for the "memoryPool" field.</summary>
public const int MemoryPoolFieldNumber = 4;
private static readonly pb::FieldCodec<global::SkyWalking.NetworkProtocol.MemoryPool> _repeated_memoryPool_codec
= pb::FieldCodec.ForMessage(34, global::SkyWalking.NetworkProtocol.MemoryPool.Parser);
private readonly pbc::RepeatedField<global::SkyWalking.NetworkProtocol.MemoryPool> memoryPool_ = new pbc::RepeatedField<global::SkyWalking.NetworkProtocol.MemoryPool>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::SkyWalking.NetworkProtocol.MemoryPool> MemoryPool {
get { return memoryPool_; }
}
/// <summary>Field number for the "gc" field.</summary>
public const int GcFieldNumber = 5;
private static readonly pb::FieldCodec<global::SkyWalking.NetworkProtocol.GC> _repeated_gc_codec
= pb::FieldCodec.ForMessage(42, global::SkyWalking.NetworkProtocol.GC.Parser);
private readonly pbc::RepeatedField<global::SkyWalking.NetworkProtocol.GC> gc_ = new pbc::RepeatedField<global::SkyWalking.NetworkProtocol.GC>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::SkyWalking.NetworkProtocol.GC> Gc {
get { return gc_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as JVMMetric);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(JVMMetric other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Time != other.Time) return false;
if (!object.Equals(Cpu, other.Cpu)) return false;
if(!memory_.Equals(other.memory_)) return false;
if(!memoryPool_.Equals(other.memoryPool_)) return false;
if(!gc_.Equals(other.gc_)) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Time != 0L) hash ^= Time.GetHashCode();
if (cpu_ != null) hash ^= Cpu.GetHashCode();
hash ^= memory_.GetHashCode();
hash ^= memoryPool_.GetHashCode();
hash ^= gc_.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Time != 0L) {
output.WriteRawTag(8);
output.WriteInt64(Time);
}
if (cpu_ != null) {
output.WriteRawTag(18);
output.WriteMessage(Cpu);
}
memory_.WriteTo(output, _repeated_memory_codec);
memoryPool_.WriteTo(output, _repeated_memoryPool_codec);
gc_.WriteTo(output, _repeated_gc_codec);
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Time != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(Time);
}
if (cpu_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Cpu);
}
size += memory_.CalculateSize(_repeated_memory_codec);
size += memoryPool_.CalculateSize(_repeated_memoryPool_codec);
size += gc_.CalculateSize(_repeated_gc_codec);
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(JVMMetric other) {
if (other == null) {
return;
}
if (other.Time != 0L) {
Time = other.Time;
}
if (other.cpu_ != null) {
if (cpu_ == null) {
cpu_ = new global::SkyWalking.NetworkProtocol.CPU();
}
Cpu.MergeFrom(other.Cpu);
}
memory_.Add(other.memory_);
memoryPool_.Add(other.memoryPool_);
gc_.Add(other.gc_);
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
Time = input.ReadInt64();
break;
}
case 18: {
if (cpu_ == null) {
cpu_ = new global::SkyWalking.NetworkProtocol.CPU();
}
input.ReadMessage(cpu_);
break;
}
case 26: {
memory_.AddEntriesFrom(input, _repeated_memory_codec);
break;
}
case 34: {
memoryPool_.AddEntriesFrom(input, _repeated_memoryPool_codec);
break;
}
case 42: {
gc_.AddEntriesFrom(input, _repeated_gc_codec);
break;
}
}
}
}
}
public sealed partial class CPU : pb::IMessage<CPU> {
private static readonly pb::MessageParser<CPU> _parser = new pb::MessageParser<CPU>(() => new CPU());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<CPU> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::SkyWalking.NetworkProtocol.JVMMetricsServiceReflection.Descriptor.MessageTypes[2]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public CPU() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public CPU(CPU other) : this() {
usagePercent_ = other.usagePercent_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public CPU Clone() {
return new CPU(this);
}
/// <summary>Field number for the "usagePercent" field.</summary>
public const int UsagePercentFieldNumber = 2;
private double usagePercent_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public double UsagePercent {
get { return usagePercent_; }
set {
usagePercent_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as CPU);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(CPU other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(UsagePercent, other.UsagePercent)) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (UsagePercent != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(UsagePercent);
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (UsagePercent != 0D) {
output.WriteRawTag(17);
output.WriteDouble(UsagePercent);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (UsagePercent != 0D) {
size += 1 + 8;
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(CPU other) {
if (other == null) {
return;
}
if (other.UsagePercent != 0D) {
UsagePercent = other.UsagePercent;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 17: {
UsagePercent = input.ReadDouble();
break;
}
}
}
}
}
public sealed partial class Memory : pb::IMessage<Memory> {
private static readonly pb::MessageParser<Memory> _parser = new pb::MessageParser<Memory>(() => new Memory());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Memory> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::SkyWalking.NetworkProtocol.JVMMetricsServiceReflection.Descriptor.MessageTypes[3]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Memory() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Memory(Memory other) : this() {
isHeap_ = other.isHeap_;
init_ = other.init_;
max_ = other.max_;
used_ = other.used_;
committed_ = other.committed_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Memory Clone() {
return new Memory(this);
}
/// <summary>Field number for the "isHeap" field.</summary>
public const int IsHeapFieldNumber = 1;
private bool isHeap_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool IsHeap {
get { return isHeap_; }
set {
isHeap_ = value;
}
}
/// <summary>Field number for the "init" field.</summary>
public const int InitFieldNumber = 2;
private long init_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long Init {
get { return init_; }
set {
init_ = value;
}
}
/// <summary>Field number for the "max" field.</summary>
public const int MaxFieldNumber = 3;
private long max_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long Max {
get { return max_; }
set {
max_ = value;
}
}
/// <summary>Field number for the "used" field.</summary>
public const int UsedFieldNumber = 4;
private long used_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long Used {
get { return used_; }
set {
used_ = value;
}
}
/// <summary>Field number for the "committed" field.</summary>
public const int CommittedFieldNumber = 5;
private long committed_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long Committed {
get { return committed_; }
set {
committed_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as Memory);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(Memory other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (IsHeap != other.IsHeap) return false;
if (Init != other.Init) return false;
if (Max != other.Max) return false;
if (Used != other.Used) return false;
if (Committed != other.Committed) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (IsHeap != false) hash ^= IsHeap.GetHashCode();
if (Init != 0L) hash ^= Init.GetHashCode();
if (Max != 0L) hash ^= Max.GetHashCode();
if (Used != 0L) hash ^= Used.GetHashCode();
if (Committed != 0L) hash ^= Committed.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (IsHeap != false) {
output.WriteRawTag(8);
output.WriteBool(IsHeap);
}
if (Init != 0L) {
output.WriteRawTag(16);
output.WriteInt64(Init);
}
if (Max != 0L) {
output.WriteRawTag(24);
output.WriteInt64(Max);
}
if (Used != 0L) {
output.WriteRawTag(32);
output.WriteInt64(Used);
}
if (Committed != 0L) {
output.WriteRawTag(40);
output.WriteInt64(Committed);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (IsHeap != false) {
size += 1 + 1;
}
if (Init != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(Init);
}
if (Max != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(Max);
}
if (Used != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(Used);
}
if (Committed != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(Committed);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(Memory other) {
if (other == null) {
return;
}
if (other.IsHeap != false) {
IsHeap = other.IsHeap;
}
if (other.Init != 0L) {
Init = other.Init;
}
if (other.Max != 0L) {
Max = other.Max;
}
if (other.Used != 0L) {
Used = other.Used;
}
if (other.Committed != 0L) {
Committed = other.Committed;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
IsHeap = input.ReadBool();
break;
}
case 16: {
Init = input.ReadInt64();
break;
}
case 24: {
Max = input.ReadInt64();
break;
}
case 32: {
Used = input.ReadInt64();
break;
}
case 40: {
Committed = input.ReadInt64();
break;
}
}
}
}
}
public sealed partial class MemoryPool : pb::IMessage<MemoryPool> {
private static readonly pb::MessageParser<MemoryPool> _parser = new pb::MessageParser<MemoryPool>(() => new MemoryPool());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<MemoryPool> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::SkyWalking.NetworkProtocol.JVMMetricsServiceReflection.Descriptor.MessageTypes[4]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public MemoryPool() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public MemoryPool(MemoryPool other) : this() {
type_ = other.type_;
init_ = other.init_;
max_ = other.max_;
used_ = other.used_;
commited_ = other.commited_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public MemoryPool Clone() {
return new MemoryPool(this);
}
/// <summary>Field number for the "type" field.</summary>
public const int TypeFieldNumber = 1;
private global::SkyWalking.NetworkProtocol.PoolType type_ = 0;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::SkyWalking.NetworkProtocol.PoolType Type {
get { return type_; }
set {
type_ = value;
}
}
/// <summary>Field number for the "init" field.</summary>
public const int InitFieldNumber = 2;
private long init_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long Init {
get { return init_; }
set {
init_ = value;
}
}
/// <summary>Field number for the "max" field.</summary>
public const int MaxFieldNumber = 3;
private long max_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long Max {
get { return max_; }
set {
max_ = value;
}
}
/// <summary>Field number for the "used" field.</summary>
public const int UsedFieldNumber = 4;
private long used_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long Used {
get { return used_; }
set {
used_ = value;
}
}
/// <summary>Field number for the "commited" field.</summary>
public const int CommitedFieldNumber = 5;
private long commited_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long Commited {
get { return commited_; }
set {
commited_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as MemoryPool);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(MemoryPool other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Type != other.Type) return false;
if (Init != other.Init) return false;
if (Max != other.Max) return false;
if (Used != other.Used) return false;
if (Commited != other.Commited) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Type != 0) hash ^= Type.GetHashCode();
if (Init != 0L) hash ^= Init.GetHashCode();
if (Max != 0L) hash ^= Max.GetHashCode();
if (Used != 0L) hash ^= Used.GetHashCode();
if (Commited != 0L) hash ^= Commited.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Type != 0) {
output.WriteRawTag(8);
output.WriteEnum((int) Type);
}
if (Init != 0L) {
output.WriteRawTag(16);
output.WriteInt64(Init);
}
if (Max != 0L) {
output.WriteRawTag(24);
output.WriteInt64(Max);
}
if (Used != 0L) {
output.WriteRawTag(32);
output.WriteInt64(Used);
}
if (Commited != 0L) {
output.WriteRawTag(40);
output.WriteInt64(Commited);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Type != 0) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type);
}
if (Init != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(Init);
}
if (Max != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(Max);
}
if (Used != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(Used);
}
if (Commited != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(Commited);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(MemoryPool other) {
if (other == null) {
return;
}
if (other.Type != 0) {
Type = other.Type;
}
if (other.Init != 0L) {
Init = other.Init;
}
if (other.Max != 0L) {
Max = other.Max;
}
if (other.Used != 0L) {
Used = other.Used;
}
if (other.Commited != 0L) {
Commited = other.Commited;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
type_ = (global::SkyWalking.NetworkProtocol.PoolType) input.ReadEnum();
break;
}
case 16: {
Init = input.ReadInt64();
break;
}
case 24: {
Max = input.ReadInt64();
break;
}
case 32: {
Used = input.ReadInt64();
break;
}
case 40: {
Commited = input.ReadInt64();
break;
}
}
}
}
}
public sealed partial class GC : pb::IMessage<GC> {
private static readonly pb::MessageParser<GC> _parser = new pb::MessageParser<GC>(() => new GC());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<GC> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::SkyWalking.NetworkProtocol.JVMMetricsServiceReflection.Descriptor.MessageTypes[5]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GC() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GC(GC other) : this() {
phrase_ = other.phrase_;
count_ = other.count_;
time_ = other.time_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GC Clone() {
return new GC(this);
}
/// <summary>Field number for the "phrase" field.</summary>
public const int PhraseFieldNumber = 1;
private global::SkyWalking.NetworkProtocol.GCPhrase phrase_ = 0;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::SkyWalking.NetworkProtocol.GCPhrase Phrase {
get { return phrase_; }
set {
phrase_ = value;
}
}
/// <summary>Field number for the "count" field.</summary>
public const int CountFieldNumber = 2;
private long count_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long Count {
get { return count_; }
set {
count_ = value;
}
}
/// <summary>Field number for the "time" field.</summary>
public const int TimeFieldNumber = 3;
private long time_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long Time {
get { return time_; }
set {
time_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as GC);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(GC other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Phrase != other.Phrase) return false;
if (Count != other.Count) return false;
if (Time != other.Time) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Phrase != 0) hash ^= Phrase.GetHashCode();
if (Count != 0L) hash ^= Count.GetHashCode();
if (Time != 0L) hash ^= Time.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Phrase != 0) {
output.WriteRawTag(8);
output.WriteEnum((int) Phrase);
}
if (Count != 0L) {
output.WriteRawTag(16);
output.WriteInt64(Count);
}
if (Time != 0L) {
output.WriteRawTag(24);
output.WriteInt64(Time);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Phrase != 0) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Phrase);
}
if (Count != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(Count);
}
if (Time != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(Time);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(GC other) {
if (other == null) {
return;
}
if (other.Phrase != 0) {
Phrase = other.Phrase;
}
if (other.Count != 0L) {
Count = other.Count;
}
if (other.Time != 0L) {
Time = other.Time;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
phrase_ = (global::SkyWalking.NetworkProtocol.GCPhrase) input.ReadEnum();
break;
}
case 16: {
Count = input.ReadInt64();
break;
}
case 24: {
Time = input.ReadInt64();
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: JVMMetricsService.proto
// </auto-generated>
#pragma warning disable 0414, 1591
#region Designer generated code
using grpc = global::Grpc.Core;
namespace SkyWalking.NetworkProtocol {
public static partial class JVMMetricsService
{
static readonly string __ServiceName = "JVMMetricsService";
static readonly grpc::Marshaller<global::SkyWalking.NetworkProtocol.JVMMetrics> __Marshaller_JVMMetrics = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::SkyWalking.NetworkProtocol.JVMMetrics.Parser.ParseFrom);
static readonly grpc::Marshaller<global::SkyWalking.NetworkProtocol.Downstream> __Marshaller_Downstream = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::SkyWalking.NetworkProtocol.Downstream.Parser.ParseFrom);
static readonly grpc::Method<global::SkyWalking.NetworkProtocol.JVMMetrics, global::SkyWalking.NetworkProtocol.Downstream> __Method_collect = new grpc::Method<global::SkyWalking.NetworkProtocol.JVMMetrics, global::SkyWalking.NetworkProtocol.Downstream>(
grpc::MethodType.Unary,
__ServiceName,
"collect",
__Marshaller_JVMMetrics,
__Marshaller_Downstream);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
{
get { return global::SkyWalking.NetworkProtocol.JVMMetricsServiceReflection.Descriptor.Services[0]; }
}
/// <summary>Base class for server-side implementations of JVMMetricsService</summary>
public abstract partial class JVMMetricsServiceBase
{
public virtual global::System.Threading.Tasks.Task<global::SkyWalking.NetworkProtocol.Downstream> collect(global::SkyWalking.NetworkProtocol.JVMMetrics request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
}
/// <summary>Client for JVMMetricsService</summary>
public partial class JVMMetricsServiceClient : grpc::ClientBase<JVMMetricsServiceClient>
{
/// <summary>Creates a new client for JVMMetricsService</summary>
/// <param name="channel">The channel to use to make remote calls.</param>
public JVMMetricsServiceClient(grpc::Channel channel) : base(channel)
{
}
/// <summary>Creates a new client for JVMMetricsService that uses a custom <c>CallInvoker</c>.</summary>
/// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
public JVMMetricsServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker)
{
}
/// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
protected JVMMetricsServiceClient() : base()
{
}
/// <summary>Protected constructor to allow creation of configured clients.</summary>
/// <param name="configuration">The client configuration.</param>
protected JVMMetricsServiceClient(ClientBaseConfiguration configuration) : base(configuration)
{
}
public virtual global::SkyWalking.NetworkProtocol.Downstream collect(global::SkyWalking.NetworkProtocol.JVMMetrics request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return collect(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
public virtual global::SkyWalking.NetworkProtocol.Downstream collect(global::SkyWalking.NetworkProtocol.JVMMetrics request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_collect, null, options, request);
}
public virtual grpc::AsyncUnaryCall<global::SkyWalking.NetworkProtocol.Downstream> collectAsync(global::SkyWalking.NetworkProtocol.JVMMetrics request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return collectAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
public virtual grpc::AsyncUnaryCall<global::SkyWalking.NetworkProtocol.Downstream> collectAsync(global::SkyWalking.NetworkProtocol.JVMMetrics request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_collect, null, options, request);
}
/// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
protected override JVMMetricsServiceClient NewInstance(ClientBaseConfiguration configuration)
{
return new JVMMetricsServiceClient(configuration);
}
}
/// <summary>Creates service definition that can be registered with a server</summary>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static grpc::ServerServiceDefinition BindService(JVMMetricsServiceBase serviceImpl)
{
return grpc::ServerServiceDefinition.CreateBuilder()
.AddMethod(__Method_collect, serviceImpl.collect).Build();
}
}
}
#endregion
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: KeyWithIntegerValue.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace SkyWalking.NetworkProtocol {
/// <summary>Holder for reflection information generated from KeyWithIntegerValue.proto</summary>
public static partial class KeyWithIntegerValueReflection {
#region Descriptor
/// <summary>File descriptor for KeyWithIntegerValue.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static KeyWithIntegerValueReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"ChlLZXlXaXRoSW50ZWdlclZhbHVlLnByb3RvIjEKE0tleVdpdGhJbnRlZ2Vy",
"VmFsdWUSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgFQkgKJ29yZy5hcGFj",
"aGUuc2t5d2Fsa2luZy5hcG0ubmV0d29yay5wcm90b1ABqgIaU2t5V2Fsa2lu",
"Zy5OZXR3b3JrUHJvdG9jb2xiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::SkyWalking.NetworkProtocol.KeyWithIntegerValue), global::SkyWalking.NetworkProtocol.KeyWithIntegerValue.Parser, new[]{ "Key", "Value" }, null, null, null)
}));
}
#endregion
}
#region Messages
public sealed partial class KeyWithIntegerValue : pb::IMessage<KeyWithIntegerValue> {
private static readonly pb::MessageParser<KeyWithIntegerValue> _parser = new pb::MessageParser<KeyWithIntegerValue>(() => new KeyWithIntegerValue());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<KeyWithIntegerValue> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::SkyWalking.NetworkProtocol.KeyWithIntegerValueReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public KeyWithIntegerValue() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public KeyWithIntegerValue(KeyWithIntegerValue other) : this() {
key_ = other.key_;
value_ = other.value_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public KeyWithIntegerValue Clone() {
return new KeyWithIntegerValue(this);
}
/// <summary>Field number for the "key" field.</summary>
public const int KeyFieldNumber = 1;
private string key_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Key {
get { return key_; }
set {
key_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "value" field.</summary>
public const int ValueFieldNumber = 2;
private int value_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int Value {
get { return value_; }
set {
value_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as KeyWithIntegerValue);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(KeyWithIntegerValue other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Key != other.Key) return false;
if (Value != other.Value) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Key.Length != 0) hash ^= Key.GetHashCode();
if (Value != 0) hash ^= Value.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Key.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Key);
}
if (Value != 0) {
output.WriteRawTag(16);
output.WriteInt32(Value);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Key.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Key);
}
if (Value != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(Value);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(KeyWithIntegerValue other) {
if (other == null) {
return;
}
if (other.Key.Length != 0) {
Key = other.Key;
}
if (other.Value != 0) {
Value = other.Value;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
Key = input.ReadString();
break;
}
case 16: {
Value = input.ReadInt32();
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: KeyWithStringValue.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace SkyWalking.NetworkProtocol {
/// <summary>Holder for reflection information generated from KeyWithStringValue.proto</summary>
public static partial class KeyWithStringValueReflection {
#region Descriptor
/// <summary>File descriptor for KeyWithStringValue.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static KeyWithStringValueReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"ChhLZXlXaXRoU3RyaW5nVmFsdWUucHJvdG8iMAoSS2V5V2l0aFN0cmluZ1Zh",
"bHVlEgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCUJICidvcmcuYXBhY2hl",
"LnNreXdhbGtpbmcuYXBtLm5ldHdvcmsucHJvdG9QAaoCGlNreVdhbGtpbmcu",
"TmV0d29ya1Byb3RvY29sYgZwcm90bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::SkyWalking.NetworkProtocol.KeyWithStringValue), global::SkyWalking.NetworkProtocol.KeyWithStringValue.Parser, new[]{ "Key", "Value" }, null, null, null)
}));
}
#endregion
}
#region Messages
public sealed partial class KeyWithStringValue : pb::IMessage<KeyWithStringValue> {
private static readonly pb::MessageParser<KeyWithStringValue> _parser = new pb::MessageParser<KeyWithStringValue>(() => new KeyWithStringValue());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<KeyWithStringValue> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::SkyWalking.NetworkProtocol.KeyWithStringValueReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public KeyWithStringValue() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public KeyWithStringValue(KeyWithStringValue other) : this() {
key_ = other.key_;
value_ = other.value_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public KeyWithStringValue Clone() {
return new KeyWithStringValue(this);
}
/// <summary>Field number for the "key" field.</summary>
public const int KeyFieldNumber = 1;
private string key_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Key {
get { return key_; }
set {
key_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "value" field.</summary>
public const int ValueFieldNumber = 2;
private string value_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Value {
get { return value_; }
set {
value_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as KeyWithStringValue);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(KeyWithStringValue other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Key != other.Key) return false;
if (Value != other.Value) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Key.Length != 0) hash ^= Key.GetHashCode();
if (Value.Length != 0) hash ^= Value.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Key.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Key);
}
if (Value.Length != 0) {
output.WriteRawTag(18);
output.WriteString(Value);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Key.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Key);
}
if (Value.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Value);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(KeyWithStringValue other) {
if (other == null) {
return;
}
if (other.Key.Length != 0) {
Key = other.Key;
}
if (other.Value.Length != 0) {
Value = other.Value;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
Key = input.ReadString();
break;
}
case 18: {
Value = input.ReadString();
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: NetworkAddressRegisterService.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace SkyWalking.NetworkProtocol {
/// <summary>Holder for reflection information generated from NetworkAddressRegisterService.proto</summary>
public static partial class NetworkAddressRegisterServiceReflection {
#region Descriptor
/// <summary>File descriptor for NetworkAddressRegisterService.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static NetworkAddressRegisterServiceReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CiNOZXR3b3JrQWRkcmVzc1JlZ2lzdGVyU2VydmljZS5wcm90bxoZS2V5V2l0",
"aEludGVnZXJWYWx1ZS5wcm90byIlChBOZXR3b3JrQWRkcmVzc2VzEhEKCWFk",
"ZHJlc3NlcxgBIAMoCSJCChZOZXR3b3JrQWRkcmVzc01hcHBpbmdzEigKCmFk",
"ZHJlc3NJZHMYASADKAsyFC5LZXlXaXRoSW50ZWdlclZhbHVlMl4KHU5ldHdv",
"cmtBZGRyZXNzUmVnaXN0ZXJTZXJ2aWNlEj0KDWJhdGNoUmVnaXN0ZXISES5O",
"ZXR3b3JrQWRkcmVzc2VzGhcuTmV0d29ya0FkZHJlc3NNYXBwaW5ncyIAQkgK",
"J29yZy5hcGFjaGUuc2t5d2Fsa2luZy5hcG0ubmV0d29yay5wcm90b1ABqgIa",
"U2t5V2Fsa2luZy5OZXR3b3JrUHJvdG9jb2xiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::SkyWalking.NetworkProtocol.KeyWithIntegerValueReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::SkyWalking.NetworkProtocol.NetworkAddresses), global::SkyWalking.NetworkProtocol.NetworkAddresses.Parser, new[]{ "Addresses" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::SkyWalking.NetworkProtocol.NetworkAddressMappings), global::SkyWalking.NetworkProtocol.NetworkAddressMappings.Parser, new[]{ "AddressIds" }, null, null, null)
}));
}
#endregion
}
#region Messages
public sealed partial class NetworkAddresses : pb::IMessage<NetworkAddresses> {
private static readonly pb::MessageParser<NetworkAddresses> _parser = new pb::MessageParser<NetworkAddresses>(() => new NetworkAddresses());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<NetworkAddresses> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::SkyWalking.NetworkProtocol.NetworkAddressRegisterServiceReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public NetworkAddresses() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public NetworkAddresses(NetworkAddresses other) : this() {
addresses_ = other.addresses_.Clone();
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public NetworkAddresses Clone() {
return new NetworkAddresses(this);
}
/// <summary>Field number for the "addresses" field.</summary>
public const int AddressesFieldNumber = 1;
private static readonly pb::FieldCodec<string> _repeated_addresses_codec
= pb::FieldCodec.ForString(10);
private readonly pbc::RepeatedField<string> addresses_ = new pbc::RepeatedField<string>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<string> Addresses {
get { return addresses_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as NetworkAddresses);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(NetworkAddresses other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if(!addresses_.Equals(other.addresses_)) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= addresses_.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
addresses_.WriteTo(output, _repeated_addresses_codec);
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += addresses_.CalculateSize(_repeated_addresses_codec);
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(NetworkAddresses other) {
if (other == null) {
return;
}
addresses_.Add(other.addresses_);
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
addresses_.AddEntriesFrom(input, _repeated_addresses_codec);
break;
}
}
}
}
}
public sealed partial class NetworkAddressMappings : pb::IMessage<NetworkAddressMappings> {
private static readonly pb::MessageParser<NetworkAddressMappings> _parser = new pb::MessageParser<NetworkAddressMappings>(() => new NetworkAddressMappings());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<NetworkAddressMappings> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::SkyWalking.NetworkProtocol.NetworkAddressRegisterServiceReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public NetworkAddressMappings() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public NetworkAddressMappings(NetworkAddressMappings other) : this() {
addressIds_ = other.addressIds_.Clone();
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public NetworkAddressMappings Clone() {
return new NetworkAddressMappings(this);
}
/// <summary>Field number for the "addressIds" field.</summary>
public const int AddressIdsFieldNumber = 1;
private static readonly pb::FieldCodec<global::SkyWalking.NetworkProtocol.KeyWithIntegerValue> _repeated_addressIds_codec
= pb::FieldCodec.ForMessage(10, global::SkyWalking.NetworkProtocol.KeyWithIntegerValue.Parser);
private readonly pbc::RepeatedField<global::SkyWalking.NetworkProtocol.KeyWithIntegerValue> addressIds_ = new pbc::RepeatedField<global::SkyWalking.NetworkProtocol.KeyWithIntegerValue>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::SkyWalking.NetworkProtocol.KeyWithIntegerValue> AddressIds {
get { return addressIds_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as NetworkAddressMappings);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(NetworkAddressMappings other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if(!addressIds_.Equals(other.addressIds_)) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= addressIds_.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
addressIds_.WriteTo(output, _repeated_addressIds_codec);
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += addressIds_.CalculateSize(_repeated_addressIds_codec);
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(NetworkAddressMappings other) {
if (other == null) {
return;
}
addressIds_.Add(other.addressIds_);
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
addressIds_.AddEntriesFrom(input, _repeated_addressIds_codec);
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: NetworkAddressRegisterService.proto
// </auto-generated>
#pragma warning disable 0414, 1591
#region Designer generated code
using grpc = global::Grpc.Core;
namespace SkyWalking.NetworkProtocol {
public static partial class NetworkAddressRegisterService
{
static readonly string __ServiceName = "NetworkAddressRegisterService";
static readonly grpc::Marshaller<global::SkyWalking.NetworkProtocol.NetworkAddresses> __Marshaller_NetworkAddresses = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::SkyWalking.NetworkProtocol.NetworkAddresses.Parser.ParseFrom);
static readonly grpc::Marshaller<global::SkyWalking.NetworkProtocol.NetworkAddressMappings> __Marshaller_NetworkAddressMappings = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::SkyWalking.NetworkProtocol.NetworkAddressMappings.Parser.ParseFrom);
static readonly grpc::Method<global::SkyWalking.NetworkProtocol.NetworkAddresses, global::SkyWalking.NetworkProtocol.NetworkAddressMappings> __Method_batchRegister = new grpc::Method<global::SkyWalking.NetworkProtocol.NetworkAddresses, global::SkyWalking.NetworkProtocol.NetworkAddressMappings>(
grpc::MethodType.Unary,
__ServiceName,
"batchRegister",
__Marshaller_NetworkAddresses,
__Marshaller_NetworkAddressMappings);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
{
get { return global::SkyWalking.NetworkProtocol.NetworkAddressRegisterServiceReflection.Descriptor.Services[0]; }
}
/// <summary>Base class for server-side implementations of NetworkAddressRegisterService</summary>
public abstract partial class NetworkAddressRegisterServiceBase
{
public virtual global::System.Threading.Tasks.Task<global::SkyWalking.NetworkProtocol.NetworkAddressMappings> batchRegister(global::SkyWalking.NetworkProtocol.NetworkAddresses request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
}
/// <summary>Client for NetworkAddressRegisterService</summary>
public partial class NetworkAddressRegisterServiceClient : grpc::ClientBase<NetworkAddressRegisterServiceClient>
{
/// <summary>Creates a new client for NetworkAddressRegisterService</summary>
/// <param name="channel">The channel to use to make remote calls.</param>
public NetworkAddressRegisterServiceClient(grpc::Channel channel) : base(channel)
{
}
/// <summary>Creates a new client for NetworkAddressRegisterService that uses a custom <c>CallInvoker</c>.</summary>
/// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
public NetworkAddressRegisterServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker)
{
}
/// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
protected NetworkAddressRegisterServiceClient() : base()
{
}
/// <summary>Protected constructor to allow creation of configured clients.</summary>
/// <param name="configuration">The client configuration.</param>
protected NetworkAddressRegisterServiceClient(ClientBaseConfiguration configuration) : base(configuration)
{
}
public virtual global::SkyWalking.NetworkProtocol.NetworkAddressMappings batchRegister(global::SkyWalking.NetworkProtocol.NetworkAddresses request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return batchRegister(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
public virtual global::SkyWalking.NetworkProtocol.NetworkAddressMappings batchRegister(global::SkyWalking.NetworkProtocol.NetworkAddresses request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_batchRegister, null, options, request);
}
public virtual grpc::AsyncUnaryCall<global::SkyWalking.NetworkProtocol.NetworkAddressMappings> batchRegisterAsync(global::SkyWalking.NetworkProtocol.NetworkAddresses request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return batchRegisterAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
public virtual grpc::AsyncUnaryCall<global::SkyWalking.NetworkProtocol.NetworkAddressMappings> batchRegisterAsync(global::SkyWalking.NetworkProtocol.NetworkAddresses request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_batchRegister, null, options, request);
}
/// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
protected override NetworkAddressRegisterServiceClient NewInstance(ClientBaseConfiguration configuration)
{
return new NetworkAddressRegisterServiceClient(configuration);
}
}
/// <summary>Creates service definition that can be registered with a server</summary>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static grpc::ServerServiceDefinition BindService(NetworkAddressRegisterServiceBase serviceImpl)
{
return grpc::ServerServiceDefinition.CreateBuilder()
.AddMethod(__Method_batchRegister, serviceImpl.batchRegister).Build();
}
}
}
#endregion
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: TraceSegmentService.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace SkyWalking.NetworkProtocol {
/// <summary>Holder for reflection information generated from TraceSegmentService.proto</summary>
public static partial class TraceSegmentServiceReflection {
#region Descriptor
/// <summary>File descriptor for TraceSegmentService.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static TraceSegmentServiceReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"ChlUcmFjZVNlZ21lbnRTZXJ2aWNlLnByb3RvGgxDb21tb24ucHJvdG8aEERv",
"d25zdHJlYW0ucHJvdG8aGEtleVdpdGhTdHJpbmdWYWx1ZS5wcm90byJFCg9V",
"cHN0cmVhbVNlZ21lbnQSIQoOZ2xvYmFsVHJhY2VJZHMYASADKAsyCS5Vbmlx",
"dWVJZBIPCgdzZWdtZW50GAIgASgMIhsKCFVuaXF1ZUlkEg8KB2lkUGFydHMY",
"ASADKAMioAEKElRyYWNlU2VnbWVudE9iamVjdBIhCg50cmFjZVNlZ21lbnRJ",
"ZBgBIAEoCzIJLlVuaXF1ZUlkEhoKBXNwYW5zGAIgAygLMgsuU3Bhbk9iamVj",
"dBIVCg1hcHBsaWNhdGlvbklkGAMgASgFEh0KFWFwcGxpY2F0aW9uSW5zdGFu",
"Y2VJZBgEIAEoBRIVCg1pc1NpemVMaW1pdGVkGAUgASgIItICChVUcmFjZVNl",
"Z21lbnRSZWZlcmVuY2USGQoHcmVmVHlwZRgBIAEoDjIILlJlZlR5cGUSJwoU",
"cGFyZW50VHJhY2VTZWdtZW50SWQYAiABKAsyCS5VbmlxdWVJZBIUCgxwYXJl",
"bnRTcGFuSWQYAyABKAUSIwobcGFyZW50QXBwbGljYXRpb25JbnN0YW5jZUlk",
"GAQgASgFEhYKDm5ldHdvcmtBZGRyZXNzGAUgASgJEhgKEG5ldHdvcmtBZGRy",
"ZXNzSWQYBiABKAUSIgoaZW50cnlBcHBsaWNhdGlvbkluc3RhbmNlSWQYByAB",
"KAUSGAoQZW50cnlTZXJ2aWNlTmFtZRgIIAEoCRIWCg5lbnRyeVNlcnZpY2VJ",
"ZBgJIAEoBRIZChFwYXJlbnRTZXJ2aWNlTmFtZRgKIAEoCRIXCg9wYXJlbnRT",
"ZXJ2aWNlSWQYCyABKAUi/QIKClNwYW5PYmplY3QSDgoGc3BhbklkGAEgASgF",
"EhQKDHBhcmVudFNwYW5JZBgCIAEoBRIRCglzdGFydFRpbWUYAyABKAMSDwoH",
"ZW5kVGltZRgEIAEoAxIkCgRyZWZzGAUgAygLMhYuVHJhY2VTZWdtZW50UmVm",
"ZXJlbmNlEhcKD29wZXJhdGlvbk5hbWVJZBgGIAEoBRIVCg1vcGVyYXRpb25O",
"YW1lGAcgASgJEg4KBnBlZXJJZBgIIAEoBRIMCgRwZWVyGAkgASgJEhsKCHNw",
"YW5UeXBlGAogASgOMgkuU3BhblR5cGUSHQoJc3BhbkxheWVyGAsgASgOMgou",
"U3BhbkxheWVyEhMKC2NvbXBvbmVudElkGAwgASgFEhEKCWNvbXBvbmVudBgN",
"IAEoCRIPCgdpc0Vycm9yGA4gASgIEiEKBHRhZ3MYDyADKAsyEy5LZXlXaXRo",
"U3RyaW5nVmFsdWUSGQoEbG9ncxgQIAMoCzILLkxvZ01lc3NhZ2UiPQoKTG9n",
"TWVzc2FnZRIMCgR0aW1lGAEgASgDEiEKBGRhdGEYAiADKAsyEy5LZXlXaXRo",
"U3RyaW5nVmFsdWUqLAoHUmVmVHlwZRIQCgxDcm9zc1Byb2Nlc3MQABIPCgtD",
"cm9zc1RocmVhZBABKlUKCVNwYW5MYXllchILCgdVbmtub3duEAASDAoIRGF0",
"YWJhc2UQARIQCgxSUENGcmFtZXdvcmsQAhIICgRIdHRwEAMSBgoCTVEQBBIJ",
"CgVDYWNoZRAFMkMKE1RyYWNlU2VnbWVudFNlcnZpY2USLAoHY29sbGVjdBIQ",
"LlVwc3RyZWFtU2VnbWVudBoLLkRvd25zdHJlYW0iACgBQkgKJ29yZy5hcGFj",
"aGUuc2t5d2Fsa2luZy5hcG0ubmV0d29yay5wcm90b1ABqgIaU2t5V2Fsa2lu",
"Zy5OZXR3b3JrUHJvdG9jb2xiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::SkyWalking.NetworkProtocol.CommonReflection.Descriptor, global::SkyWalking.NetworkProtocol.DownstreamReflection.Descriptor, global::SkyWalking.NetworkProtocol.KeyWithStringValueReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(new[] {typeof(global::SkyWalking.NetworkProtocol.RefType), typeof(global::SkyWalking.NetworkProtocol.SpanLayer), }, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::SkyWalking.NetworkProtocol.UpstreamSegment), global::SkyWalking.NetworkProtocol.UpstreamSegment.Parser, new[]{ "GlobalTraceIds", "Segment" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::SkyWalking.NetworkProtocol.UniqueId), global::SkyWalking.NetworkProtocol.UniqueId.Parser, new[]{ "IdParts" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::SkyWalking.NetworkProtocol.TraceSegmentObject), global::SkyWalking.NetworkProtocol.TraceSegmentObject.Parser, new[]{ "TraceSegmentId", "Spans", "ApplicationId", "ApplicationInstanceId", "IsSizeLimited" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::SkyWalking.NetworkProtocol.TraceSegmentReference), global::SkyWalking.NetworkProtocol.TraceSegmentReference.Parser, new[]{ "RefType", "ParentTraceSegmentId", "ParentSpanId", "ParentApplicationInstanceId", "NetworkAddress", "NetworkAddressId", "EntryApplicationInstanceId", "EntryServiceName", "EntryServiceId", "ParentServiceName", "ParentServiceId" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::SkyWalking.NetworkProtocol.SpanObject), global::SkyWalking.NetworkProtocol.SpanObject.Parser, new[]{ "SpanId", "ParentSpanId", "StartTime", "EndTime", "Refs", "OperationNameId", "OperationName", "PeerId", "Peer", "SpanType", "SpanLayer", "ComponentId", "Component", "IsError", "Tags", "Logs" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::SkyWalking.NetworkProtocol.LogMessage), global::SkyWalking.NetworkProtocol.LogMessage.Parser, new[]{ "Time", "Data" }, null, null, null)
}));
}
#endregion
}
#region Enums
public enum RefType {
[pbr::OriginalName("CrossProcess")] CrossProcess = 0,
[pbr::OriginalName("CrossThread")] CrossThread = 1,
}
public enum SpanLayer {
[pbr::OriginalName("Unknown")] Unknown = 0,
[pbr::OriginalName("Database")] Database = 1,
[pbr::OriginalName("RPCFramework")] Rpcframework = 2,
[pbr::OriginalName("Http")] Http = 3,
[pbr::OriginalName("MQ")] Mq = 4,
[pbr::OriginalName("Cache")] Cache = 5,
}
#endregion
#region Messages
public sealed partial class UpstreamSegment : pb::IMessage<UpstreamSegment> {
private static readonly pb::MessageParser<UpstreamSegment> _parser = new pb::MessageParser<UpstreamSegment>(() => new UpstreamSegment());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<UpstreamSegment> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::SkyWalking.NetworkProtocol.TraceSegmentServiceReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public UpstreamSegment() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public UpstreamSegment(UpstreamSegment other) : this() {
globalTraceIds_ = other.globalTraceIds_.Clone();
segment_ = other.segment_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public UpstreamSegment Clone() {
return new UpstreamSegment(this);
}
/// <summary>Field number for the "globalTraceIds" field.</summary>
public const int GlobalTraceIdsFieldNumber = 1;
private static readonly pb::FieldCodec<global::SkyWalking.NetworkProtocol.UniqueId> _repeated_globalTraceIds_codec
= pb::FieldCodec.ForMessage(10, global::SkyWalking.NetworkProtocol.UniqueId.Parser);
private readonly pbc::RepeatedField<global::SkyWalking.NetworkProtocol.UniqueId> globalTraceIds_ = new pbc::RepeatedField<global::SkyWalking.NetworkProtocol.UniqueId>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::SkyWalking.NetworkProtocol.UniqueId> GlobalTraceIds {
get { return globalTraceIds_; }
}
/// <summary>Field number for the "segment" field.</summary>
public const int SegmentFieldNumber = 2;
private pb::ByteString segment_ = pb::ByteString.Empty;
/// <summary>
/// the byte array of TraceSegmentObject
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pb::ByteString Segment {
get { return segment_; }
set {
segment_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as UpstreamSegment);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(UpstreamSegment other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if(!globalTraceIds_.Equals(other.globalTraceIds_)) return false;
if (Segment != other.Segment) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= globalTraceIds_.GetHashCode();
if (Segment.Length != 0) hash ^= Segment.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
globalTraceIds_.WriteTo(output, _repeated_globalTraceIds_codec);
if (Segment.Length != 0) {
output.WriteRawTag(18);
output.WriteBytes(Segment);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += globalTraceIds_.CalculateSize(_repeated_globalTraceIds_codec);
if (Segment.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeBytesSize(Segment);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(UpstreamSegment other) {
if (other == null) {
return;
}
globalTraceIds_.Add(other.globalTraceIds_);
if (other.Segment.Length != 0) {
Segment = other.Segment;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
globalTraceIds_.AddEntriesFrom(input, _repeated_globalTraceIds_codec);
break;
}
case 18: {
Segment = input.ReadBytes();
break;
}
}
}
}
}
public sealed partial class UniqueId : pb::IMessage<UniqueId> {
private static readonly pb::MessageParser<UniqueId> _parser = new pb::MessageParser<UniqueId>(() => new UniqueId());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<UniqueId> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::SkyWalking.NetworkProtocol.TraceSegmentServiceReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public UniqueId() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public UniqueId(UniqueId other) : this() {
idParts_ = other.idParts_.Clone();
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public UniqueId Clone() {
return new UniqueId(this);
}
/// <summary>Field number for the "idParts" field.</summary>
public const int IdPartsFieldNumber = 1;
private static readonly pb::FieldCodec<long> _repeated_idParts_codec
= pb::FieldCodec.ForInt64(10);
private readonly pbc::RepeatedField<long> idParts_ = new pbc::RepeatedField<long>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<long> IdParts {
get { return idParts_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as UniqueId);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(UniqueId other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if(!idParts_.Equals(other.idParts_)) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= idParts_.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
idParts_.WriteTo(output, _repeated_idParts_codec);
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += idParts_.CalculateSize(_repeated_idParts_codec);
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(UniqueId other) {
if (other == null) {
return;
}
idParts_.Add(other.idParts_);
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10:
case 8: {
idParts_.AddEntriesFrom(input, _repeated_idParts_codec);
break;
}
}
}
}
}
public sealed partial class TraceSegmentObject : pb::IMessage<TraceSegmentObject> {
private static readonly pb::MessageParser<TraceSegmentObject> _parser = new pb::MessageParser<TraceSegmentObject>(() => new TraceSegmentObject());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TraceSegmentObject> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::SkyWalking.NetworkProtocol.TraceSegmentServiceReflection.Descriptor.MessageTypes[2]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TraceSegmentObject() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TraceSegmentObject(TraceSegmentObject other) : this() {
traceSegmentId_ = other.traceSegmentId_ != null ? other.traceSegmentId_.Clone() : null;
spans_ = other.spans_.Clone();
applicationId_ = other.applicationId_;
applicationInstanceId_ = other.applicationInstanceId_;
isSizeLimited_ = other.isSizeLimited_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TraceSegmentObject Clone() {
return new TraceSegmentObject(this);
}
/// <summary>Field number for the "traceSegmentId" field.</summary>
public const int TraceSegmentIdFieldNumber = 1;
private global::SkyWalking.NetworkProtocol.UniqueId traceSegmentId_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::SkyWalking.NetworkProtocol.UniqueId TraceSegmentId {
get { return traceSegmentId_; }
set {
traceSegmentId_ = value;
}
}
/// <summary>Field number for the "spans" field.</summary>
public const int SpansFieldNumber = 2;
private static readonly pb::FieldCodec<global::SkyWalking.NetworkProtocol.SpanObject> _repeated_spans_codec
= pb::FieldCodec.ForMessage(18, global::SkyWalking.NetworkProtocol.SpanObject.Parser);
private readonly pbc::RepeatedField<global::SkyWalking.NetworkProtocol.SpanObject> spans_ = new pbc::RepeatedField<global::SkyWalking.NetworkProtocol.SpanObject>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::SkyWalking.NetworkProtocol.SpanObject> Spans {
get { return spans_; }
}
/// <summary>Field number for the "applicationId" field.</summary>
public const int ApplicationIdFieldNumber = 3;
private int applicationId_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int ApplicationId {
get { return applicationId_; }
set {
applicationId_ = value;
}
}
/// <summary>Field number for the "applicationInstanceId" field.</summary>
public const int ApplicationInstanceIdFieldNumber = 4;
private int applicationInstanceId_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int ApplicationInstanceId {
get { return applicationInstanceId_; }
set {
applicationInstanceId_ = value;
}
}
/// <summary>Field number for the "isSizeLimited" field.</summary>
public const int IsSizeLimitedFieldNumber = 5;
private bool isSizeLimited_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool IsSizeLimited {
get { return isSizeLimited_; }
set {
isSizeLimited_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as TraceSegmentObject);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(TraceSegmentObject other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (!object.Equals(TraceSegmentId, other.TraceSegmentId)) return false;
if(!spans_.Equals(other.spans_)) return false;
if (ApplicationId != other.ApplicationId) return false;
if (ApplicationInstanceId != other.ApplicationInstanceId) return false;
if (IsSizeLimited != other.IsSizeLimited) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (traceSegmentId_ != null) hash ^= TraceSegmentId.GetHashCode();
hash ^= spans_.GetHashCode();
if (ApplicationId != 0) hash ^= ApplicationId.GetHashCode();
if (ApplicationInstanceId != 0) hash ^= ApplicationInstanceId.GetHashCode();
if (IsSizeLimited != false) hash ^= IsSizeLimited.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (traceSegmentId_ != null) {
output.WriteRawTag(10);
output.WriteMessage(TraceSegmentId);
}
spans_.WriteTo(output, _repeated_spans_codec);
if (ApplicationId != 0) {
output.WriteRawTag(24);
output.WriteInt32(ApplicationId);
}
if (ApplicationInstanceId != 0) {
output.WriteRawTag(32);
output.WriteInt32(ApplicationInstanceId);
}
if (IsSizeLimited != false) {
output.WriteRawTag(40);
output.WriteBool(IsSizeLimited);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (traceSegmentId_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(TraceSegmentId);
}
size += spans_.CalculateSize(_repeated_spans_codec);
if (ApplicationId != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(ApplicationId);
}
if (ApplicationInstanceId != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(ApplicationInstanceId);
}
if (IsSizeLimited != false) {
size += 1 + 1;
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(TraceSegmentObject other) {
if (other == null) {
return;
}
if (other.traceSegmentId_ != null) {
if (traceSegmentId_ == null) {
traceSegmentId_ = new global::SkyWalking.NetworkProtocol.UniqueId();
}
TraceSegmentId.MergeFrom(other.TraceSegmentId);
}
spans_.Add(other.spans_);
if (other.ApplicationId != 0) {
ApplicationId = other.ApplicationId;
}
if (other.ApplicationInstanceId != 0) {
ApplicationInstanceId = other.ApplicationInstanceId;
}
if (other.IsSizeLimited != false) {
IsSizeLimited = other.IsSizeLimited;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
if (traceSegmentId_ == null) {
traceSegmentId_ = new global::SkyWalking.NetworkProtocol.UniqueId();
}
input.ReadMessage(traceSegmentId_);
break;
}
case 18: {
spans_.AddEntriesFrom(input, _repeated_spans_codec);
break;
}
case 24: {
ApplicationId = input.ReadInt32();
break;
}
case 32: {
ApplicationInstanceId = input.ReadInt32();
break;
}
case 40: {
IsSizeLimited = input.ReadBool();
break;
}
}
}
}
}
public sealed partial class TraceSegmentReference : pb::IMessage<TraceSegmentReference> {
private static readonly pb::MessageParser<TraceSegmentReference> _parser = new pb::MessageParser<TraceSegmentReference>(() => new TraceSegmentReference());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TraceSegmentReference> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::SkyWalking.NetworkProtocol.TraceSegmentServiceReflection.Descriptor.MessageTypes[3]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TraceSegmentReference() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TraceSegmentReference(TraceSegmentReference other) : this() {
refType_ = other.refType_;
parentTraceSegmentId_ = other.parentTraceSegmentId_ != null ? other.parentTraceSegmentId_.Clone() : null;
parentSpanId_ = other.parentSpanId_;
parentApplicationInstanceId_ = other.parentApplicationInstanceId_;
networkAddress_ = other.networkAddress_;
networkAddressId_ = other.networkAddressId_;
entryApplicationInstanceId_ = other.entryApplicationInstanceId_;
entryServiceName_ = other.entryServiceName_;
entryServiceId_ = other.entryServiceId_;
parentServiceName_ = other.parentServiceName_;
parentServiceId_ = other.parentServiceId_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TraceSegmentReference Clone() {
return new TraceSegmentReference(this);
}
/// <summary>Field number for the "refType" field.</summary>
public const int RefTypeFieldNumber = 1;
private global::SkyWalking.NetworkProtocol.RefType refType_ = 0;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::SkyWalking.NetworkProtocol.RefType RefType {
get { return refType_; }
set {
refType_ = value;
}
}
/// <summary>Field number for the "parentTraceSegmentId" field.</summary>
public const int ParentTraceSegmentIdFieldNumber = 2;
private global::SkyWalking.NetworkProtocol.UniqueId parentTraceSegmentId_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::SkyWalking.NetworkProtocol.UniqueId ParentTraceSegmentId {
get { return parentTraceSegmentId_; }
set {
parentTraceSegmentId_ = value;
}
}
/// <summary>Field number for the "parentSpanId" field.</summary>
public const int ParentSpanIdFieldNumber = 3;
private int parentSpanId_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int ParentSpanId {
get { return parentSpanId_; }
set {
parentSpanId_ = value;
}
}
/// <summary>Field number for the "parentApplicationInstanceId" field.</summary>
public const int ParentApplicationInstanceIdFieldNumber = 4;
private int parentApplicationInstanceId_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int ParentApplicationInstanceId {
get { return parentApplicationInstanceId_; }
set {
parentApplicationInstanceId_ = value;
}
}
/// <summary>Field number for the "networkAddress" field.</summary>
public const int NetworkAddressFieldNumber = 5;
private string networkAddress_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string NetworkAddress {
get { return networkAddress_; }
set {
networkAddress_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "networkAddressId" field.</summary>
public const int NetworkAddressIdFieldNumber = 6;
private int networkAddressId_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int NetworkAddressId {
get { return networkAddressId_; }
set {
networkAddressId_ = value;
}
}
/// <summary>Field number for the "entryApplicationInstanceId" field.</summary>
public const int EntryApplicationInstanceIdFieldNumber = 7;
private int entryApplicationInstanceId_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int EntryApplicationInstanceId {
get { return entryApplicationInstanceId_; }
set {
entryApplicationInstanceId_ = value;
}
}
/// <summary>Field number for the "entryServiceName" field.</summary>
public const int EntryServiceNameFieldNumber = 8;
private string entryServiceName_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string EntryServiceName {
get { return entryServiceName_; }
set {
entryServiceName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "entryServiceId" field.</summary>
public const int EntryServiceIdFieldNumber = 9;
private int entryServiceId_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int EntryServiceId {
get { return entryServiceId_; }
set {
entryServiceId_ = value;
}
}
/// <summary>Field number for the "parentServiceName" field.</summary>
public const int ParentServiceNameFieldNumber = 10;
private string parentServiceName_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string ParentServiceName {
get { return parentServiceName_; }
set {
parentServiceName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "parentServiceId" field.</summary>
public const int ParentServiceIdFieldNumber = 11;
private int parentServiceId_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int ParentServiceId {
get { return parentServiceId_; }
set {
parentServiceId_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as TraceSegmentReference);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(TraceSegmentReference other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (RefType != other.RefType) return false;
if (!object.Equals(ParentTraceSegmentId, other.ParentTraceSegmentId)) return false;
if (ParentSpanId != other.ParentSpanId) return false;
if (ParentApplicationInstanceId != other.ParentApplicationInstanceId) return false;
if (NetworkAddress != other.NetworkAddress) return false;
if (NetworkAddressId != other.NetworkAddressId) return false;
if (EntryApplicationInstanceId != other.EntryApplicationInstanceId) return false;
if (EntryServiceName != other.EntryServiceName) return false;
if (EntryServiceId != other.EntryServiceId) return false;
if (ParentServiceName != other.ParentServiceName) return false;
if (ParentServiceId != other.ParentServiceId) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (RefType != 0) hash ^= RefType.GetHashCode();
if (parentTraceSegmentId_ != null) hash ^= ParentTraceSegmentId.GetHashCode();
if (ParentSpanId != 0) hash ^= ParentSpanId.GetHashCode();
if (ParentApplicationInstanceId != 0) hash ^= ParentApplicationInstanceId.GetHashCode();
if (NetworkAddress.Length != 0) hash ^= NetworkAddress.GetHashCode();
if (NetworkAddressId != 0) hash ^= NetworkAddressId.GetHashCode();
if (EntryApplicationInstanceId != 0) hash ^= EntryApplicationInstanceId.GetHashCode();
if (EntryServiceName.Length != 0) hash ^= EntryServiceName.GetHashCode();
if (EntryServiceId != 0) hash ^= EntryServiceId.GetHashCode();
if (ParentServiceName.Length != 0) hash ^= ParentServiceName.GetHashCode();
if (ParentServiceId != 0) hash ^= ParentServiceId.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (RefType != 0) {
output.WriteRawTag(8);
output.WriteEnum((int) RefType);
}
if (parentTraceSegmentId_ != null) {
output.WriteRawTag(18);
output.WriteMessage(ParentTraceSegmentId);
}
if (ParentSpanId != 0) {
output.WriteRawTag(24);
output.WriteInt32(ParentSpanId);
}
if (ParentApplicationInstanceId != 0) {
output.WriteRawTag(32);
output.WriteInt32(ParentApplicationInstanceId);
}
if (NetworkAddress.Length != 0) {
output.WriteRawTag(42);
output.WriteString(NetworkAddress);
}
if (NetworkAddressId != 0) {
output.WriteRawTag(48);
output.WriteInt32(NetworkAddressId);
}
if (EntryApplicationInstanceId != 0) {
output.WriteRawTag(56);
output.WriteInt32(EntryApplicationInstanceId);
}
if (EntryServiceName.Length != 0) {
output.WriteRawTag(66);
output.WriteString(EntryServiceName);
}
if (EntryServiceId != 0) {
output.WriteRawTag(72);
output.WriteInt32(EntryServiceId);
}
if (ParentServiceName.Length != 0) {
output.WriteRawTag(82);
output.WriteString(ParentServiceName);
}
if (ParentServiceId != 0) {
output.WriteRawTag(88);
output.WriteInt32(ParentServiceId);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (RefType != 0) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) RefType);
}
if (parentTraceSegmentId_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(ParentTraceSegmentId);
}
if (ParentSpanId != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(ParentSpanId);
}
if (ParentApplicationInstanceId != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(ParentApplicationInstanceId);
}
if (NetworkAddress.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(NetworkAddress);
}
if (NetworkAddressId != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(NetworkAddressId);
}
if (EntryApplicationInstanceId != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(EntryApplicationInstanceId);
}
if (EntryServiceName.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(EntryServiceName);
}
if (EntryServiceId != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(EntryServiceId);
}
if (ParentServiceName.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(ParentServiceName);
}
if (ParentServiceId != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(ParentServiceId);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(TraceSegmentReference other) {
if (other == null) {
return;
}
if (other.RefType != 0) {
RefType = other.RefType;
}
if (other.parentTraceSegmentId_ != null) {
if (parentTraceSegmentId_ == null) {
parentTraceSegmentId_ = new global::SkyWalking.NetworkProtocol.UniqueId();
}
ParentTraceSegmentId.MergeFrom(other.ParentTraceSegmentId);
}
if (other.ParentSpanId != 0) {
ParentSpanId = other.ParentSpanId;
}
if (other.ParentApplicationInstanceId != 0) {
ParentApplicationInstanceId = other.ParentApplicationInstanceId;
}
if (other.NetworkAddress.Length != 0) {
NetworkAddress = other.NetworkAddress;
}
if (other.NetworkAddressId != 0) {
NetworkAddressId = other.NetworkAddressId;
}
if (other.EntryApplicationInstanceId != 0) {
EntryApplicationInstanceId = other.EntryApplicationInstanceId;
}
if (other.EntryServiceName.Length != 0) {
EntryServiceName = other.EntryServiceName;
}
if (other.EntryServiceId != 0) {
EntryServiceId = other.EntryServiceId;
}
if (other.ParentServiceName.Length != 0) {
ParentServiceName = other.ParentServiceName;
}
if (other.ParentServiceId != 0) {
ParentServiceId = other.ParentServiceId;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
refType_ = (global::SkyWalking.NetworkProtocol.RefType) input.ReadEnum();
break;
}
case 18: {
if (parentTraceSegmentId_ == null) {
parentTraceSegmentId_ = new global::SkyWalking.NetworkProtocol.UniqueId();
}
input.ReadMessage(parentTraceSegmentId_);
break;
}
case 24: {
ParentSpanId = input.ReadInt32();
break;
}
case 32: {
ParentApplicationInstanceId = input.ReadInt32();
break;
}
case 42: {
NetworkAddress = input.ReadString();
break;
}
case 48: {
NetworkAddressId = input.ReadInt32();
break;
}
case 56: {
EntryApplicationInstanceId = input.ReadInt32();
break;
}
case 66: {
EntryServiceName = input.ReadString();
break;
}
case 72: {
EntryServiceId = input.ReadInt32();
break;
}
case 82: {
ParentServiceName = input.ReadString();
break;
}
case 88: {
ParentServiceId = input.ReadInt32();
break;
}
}
}
}
}
public sealed partial class SpanObject : pb::IMessage<SpanObject> {
private static readonly pb::MessageParser<SpanObject> _parser = new pb::MessageParser<SpanObject>(() => new SpanObject());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<SpanObject> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::SkyWalking.NetworkProtocol.TraceSegmentServiceReflection.Descriptor.MessageTypes[4]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public SpanObject() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public SpanObject(SpanObject other) : this() {
spanId_ = other.spanId_;
parentSpanId_ = other.parentSpanId_;
startTime_ = other.startTime_;
endTime_ = other.endTime_;
refs_ = other.refs_.Clone();
operationNameId_ = other.operationNameId_;
operationName_ = other.operationName_;
peerId_ = other.peerId_;
peer_ = other.peer_;
spanType_ = other.spanType_;
spanLayer_ = other.spanLayer_;
componentId_ = other.componentId_;
component_ = other.component_;
isError_ = other.isError_;
tags_ = other.tags_.Clone();
logs_ = other.logs_.Clone();
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public SpanObject Clone() {
return new SpanObject(this);
}
/// <summary>Field number for the "spanId" field.</summary>
public const int SpanIdFieldNumber = 1;
private int spanId_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int SpanId {
get { return spanId_; }
set {
spanId_ = value;
}
}
/// <summary>Field number for the "parentSpanId" field.</summary>
public const int ParentSpanIdFieldNumber = 2;
private int parentSpanId_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int ParentSpanId {
get { return parentSpanId_; }
set {
parentSpanId_ = value;
}
}
/// <summary>Field number for the "startTime" field.</summary>
public const int StartTimeFieldNumber = 3;
private long startTime_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long StartTime {
get { return startTime_; }
set {
startTime_ = value;
}
}
/// <summary>Field number for the "endTime" field.</summary>
public const int EndTimeFieldNumber = 4;
private long endTime_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long EndTime {
get { return endTime_; }
set {
endTime_ = value;
}
}
/// <summary>Field number for the "refs" field.</summary>
public const int RefsFieldNumber = 5;
private static readonly pb::FieldCodec<global::SkyWalking.NetworkProtocol.TraceSegmentReference> _repeated_refs_codec
= pb::FieldCodec.ForMessage(42, global::SkyWalking.NetworkProtocol.TraceSegmentReference.Parser);
private readonly pbc::RepeatedField<global::SkyWalking.NetworkProtocol.TraceSegmentReference> refs_ = new pbc::RepeatedField<global::SkyWalking.NetworkProtocol.TraceSegmentReference>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::SkyWalking.NetworkProtocol.TraceSegmentReference> Refs {
get { return refs_; }
}
/// <summary>Field number for the "operationNameId" field.</summary>
public const int OperationNameIdFieldNumber = 6;
private int operationNameId_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int OperationNameId {
get { return operationNameId_; }
set {
operationNameId_ = value;
}
}
/// <summary>Field number for the "operationName" field.</summary>
public const int OperationNameFieldNumber = 7;
private string operationName_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string OperationName {
get { return operationName_; }
set {
operationName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "peerId" field.</summary>
public const int PeerIdFieldNumber = 8;
private int peerId_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int PeerId {
get { return peerId_; }
set {
peerId_ = value;
}
}
/// <summary>Field number for the "peer" field.</summary>
public const int PeerFieldNumber = 9;
private string peer_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Peer {
get { return peer_; }
set {
peer_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "spanType" field.</summary>
public const int SpanTypeFieldNumber = 10;
private global::SkyWalking.NetworkProtocol.SpanType spanType_ = 0;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::SkyWalking.NetworkProtocol.SpanType SpanType {
get { return spanType_; }
set {
spanType_ = value;
}
}
/// <summary>Field number for the "spanLayer" field.</summary>
public const int SpanLayerFieldNumber = 11;
private global::SkyWalking.NetworkProtocol.SpanLayer spanLayer_ = 0;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::SkyWalking.NetworkProtocol.SpanLayer SpanLayer {
get { return spanLayer_; }
set {
spanLayer_ = value;
}
}
/// <summary>Field number for the "componentId" field.</summary>
public const int ComponentIdFieldNumber = 12;
private int componentId_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int ComponentId {
get { return componentId_; }
set {
componentId_ = value;
}
}
/// <summary>Field number for the "component" field.</summary>
public const int ComponentFieldNumber = 13;
private string component_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Component {
get { return component_; }
set {
component_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "isError" field.</summary>
public const int IsErrorFieldNumber = 14;
private bool isError_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool IsError {
get { return isError_; }
set {
isError_ = value;
}
}
/// <summary>Field number for the "tags" field.</summary>
public const int TagsFieldNumber = 15;
private static readonly pb::FieldCodec<global::SkyWalking.NetworkProtocol.KeyWithStringValue> _repeated_tags_codec
= pb::FieldCodec.ForMessage(122, global::SkyWalking.NetworkProtocol.KeyWithStringValue.Parser);
private readonly pbc::RepeatedField<global::SkyWalking.NetworkProtocol.KeyWithStringValue> tags_ = new pbc::RepeatedField<global::SkyWalking.NetworkProtocol.KeyWithStringValue>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::SkyWalking.NetworkProtocol.KeyWithStringValue> Tags {
get { return tags_; }
}
/// <summary>Field number for the "logs" field.</summary>
public const int LogsFieldNumber = 16;
private static readonly pb::FieldCodec<global::SkyWalking.NetworkProtocol.LogMessage> _repeated_logs_codec
= pb::FieldCodec.ForMessage(130, global::SkyWalking.NetworkProtocol.LogMessage.Parser);
private readonly pbc::RepeatedField<global::SkyWalking.NetworkProtocol.LogMessage> logs_ = new pbc::RepeatedField<global::SkyWalking.NetworkProtocol.LogMessage>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::SkyWalking.NetworkProtocol.LogMessage> Logs {
get { return logs_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as SpanObject);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(SpanObject other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (SpanId != other.SpanId) return false;
if (ParentSpanId != other.ParentSpanId) return false;
if (StartTime != other.StartTime) return false;
if (EndTime != other.EndTime) return false;
if(!refs_.Equals(other.refs_)) return false;
if (OperationNameId != other.OperationNameId) return false;
if (OperationName != other.OperationName) return false;
if (PeerId != other.PeerId) return false;
if (Peer != other.Peer) return false;
if (SpanType != other.SpanType) return false;
if (SpanLayer != other.SpanLayer) return false;
if (ComponentId != other.ComponentId) return false;
if (Component != other.Component) return false;
if (IsError != other.IsError) return false;
if(!tags_.Equals(other.tags_)) return false;
if(!logs_.Equals(other.logs_)) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (SpanId != 0) hash ^= SpanId.GetHashCode();
if (ParentSpanId != 0) hash ^= ParentSpanId.GetHashCode();
if (StartTime != 0L) hash ^= StartTime.GetHashCode();
if (EndTime != 0L) hash ^= EndTime.GetHashCode();
hash ^= refs_.GetHashCode();
if (OperationNameId != 0) hash ^= OperationNameId.GetHashCode();
if (OperationName.Length != 0) hash ^= OperationName.GetHashCode();
if (PeerId != 0) hash ^= PeerId.GetHashCode();
if (Peer.Length != 0) hash ^= Peer.GetHashCode();
if (SpanType != 0) hash ^= SpanType.GetHashCode();
if (SpanLayer != 0) hash ^= SpanLayer.GetHashCode();
if (ComponentId != 0) hash ^= ComponentId.GetHashCode();
if (Component.Length != 0) hash ^= Component.GetHashCode();
if (IsError != false) hash ^= IsError.GetHashCode();
hash ^= tags_.GetHashCode();
hash ^= logs_.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (SpanId != 0) {
output.WriteRawTag(8);
output.WriteInt32(SpanId);
}
if (ParentSpanId != 0) {
output.WriteRawTag(16);
output.WriteInt32(ParentSpanId);
}
if (StartTime != 0L) {
output.WriteRawTag(24);
output.WriteInt64(StartTime);
}
if (EndTime != 0L) {
output.WriteRawTag(32);
output.WriteInt64(EndTime);
}
refs_.WriteTo(output, _repeated_refs_codec);
if (OperationNameId != 0) {
output.WriteRawTag(48);
output.WriteInt32(OperationNameId);
}
if (OperationName.Length != 0) {
output.WriteRawTag(58);
output.WriteString(OperationName);
}
if (PeerId != 0) {
output.WriteRawTag(64);
output.WriteInt32(PeerId);
}
if (Peer.Length != 0) {
output.WriteRawTag(74);
output.WriteString(Peer);
}
if (SpanType != 0) {
output.WriteRawTag(80);
output.WriteEnum((int) SpanType);
}
if (SpanLayer != 0) {
output.WriteRawTag(88);
output.WriteEnum((int) SpanLayer);
}
if (ComponentId != 0) {
output.WriteRawTag(96);
output.WriteInt32(ComponentId);
}
if (Component.Length != 0) {
output.WriteRawTag(106);
output.WriteString(Component);
}
if (IsError != false) {
output.WriteRawTag(112);
output.WriteBool(IsError);
}
tags_.WriteTo(output, _repeated_tags_codec);
logs_.WriteTo(output, _repeated_logs_codec);
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (SpanId != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(SpanId);
}
if (ParentSpanId != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(ParentSpanId);
}
if (StartTime != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(StartTime);
}
if (EndTime != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(EndTime);
}
size += refs_.CalculateSize(_repeated_refs_codec);
if (OperationNameId != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(OperationNameId);
}
if (OperationName.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(OperationName);
}
if (PeerId != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(PeerId);
}
if (Peer.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Peer);
}
if (SpanType != 0) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) SpanType);
}
if (SpanLayer != 0) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) SpanLayer);
}
if (ComponentId != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(ComponentId);
}
if (Component.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Component);
}
if (IsError != false) {
size += 1 + 1;
}
size += tags_.CalculateSize(_repeated_tags_codec);
size += logs_.CalculateSize(_repeated_logs_codec);
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(SpanObject other) {
if (other == null) {
return;
}
if (other.SpanId != 0) {
SpanId = other.SpanId;
}
if (other.ParentSpanId != 0) {
ParentSpanId = other.ParentSpanId;
}
if (other.StartTime != 0L) {
StartTime = other.StartTime;
}
if (other.EndTime != 0L) {
EndTime = other.EndTime;
}
refs_.Add(other.refs_);
if (other.OperationNameId != 0) {
OperationNameId = other.OperationNameId;
}
if (other.OperationName.Length != 0) {
OperationName = other.OperationName;
}
if (other.PeerId != 0) {
PeerId = other.PeerId;
}
if (other.Peer.Length != 0) {
Peer = other.Peer;
}
if (other.SpanType != 0) {
SpanType = other.SpanType;
}
if (other.SpanLayer != 0) {
SpanLayer = other.SpanLayer;
}
if (other.ComponentId != 0) {
ComponentId = other.ComponentId;
}
if (other.Component.Length != 0) {
Component = other.Component;
}
if (other.IsError != false) {
IsError = other.IsError;
}
tags_.Add(other.tags_);
logs_.Add(other.logs_);
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
SpanId = input.ReadInt32();
break;
}
case 16: {
ParentSpanId = input.ReadInt32();
break;
}
case 24: {
StartTime = input.ReadInt64();
break;
}
case 32: {
EndTime = input.ReadInt64();
break;
}
case 42: {
refs_.AddEntriesFrom(input, _repeated_refs_codec);
break;
}
case 48: {
OperationNameId = input.ReadInt32();
break;
}
case 58: {
OperationName = input.ReadString();
break;
}
case 64: {
PeerId = input.ReadInt32();
break;
}
case 74: {
Peer = input.ReadString();
break;
}
case 80: {
spanType_ = (global::SkyWalking.NetworkProtocol.SpanType) input.ReadEnum();
break;
}
case 88: {
spanLayer_ = (global::SkyWalking.NetworkProtocol.SpanLayer) input.ReadEnum();
break;
}
case 96: {
ComponentId = input.ReadInt32();
break;
}
case 106: {
Component = input.ReadString();
break;
}
case 112: {
IsError = input.ReadBool();
break;
}
case 122: {
tags_.AddEntriesFrom(input, _repeated_tags_codec);
break;
}
case 130: {
logs_.AddEntriesFrom(input, _repeated_logs_codec);
break;
}
}
}
}
}
public sealed partial class LogMessage : pb::IMessage<LogMessage> {
private static readonly pb::MessageParser<LogMessage> _parser = new pb::MessageParser<LogMessage>(() => new LogMessage());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<LogMessage> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::SkyWalking.NetworkProtocol.TraceSegmentServiceReflection.Descriptor.MessageTypes[5]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public LogMessage() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public LogMessage(LogMessage other) : this() {
time_ = other.time_;
data_ = other.data_.Clone();
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public LogMessage Clone() {
return new LogMessage(this);
}
/// <summary>Field number for the "time" field.</summary>
public const int TimeFieldNumber = 1;
private long time_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long Time {
get { return time_; }
set {
time_ = value;
}
}
/// <summary>Field number for the "data" field.</summary>
public const int DataFieldNumber = 2;
private static readonly pb::FieldCodec<global::SkyWalking.NetworkProtocol.KeyWithStringValue> _repeated_data_codec
= pb::FieldCodec.ForMessage(18, global::SkyWalking.NetworkProtocol.KeyWithStringValue.Parser);
private readonly pbc::RepeatedField<global::SkyWalking.NetworkProtocol.KeyWithStringValue> data_ = new pbc::RepeatedField<global::SkyWalking.NetworkProtocol.KeyWithStringValue>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::SkyWalking.NetworkProtocol.KeyWithStringValue> Data {
get { return data_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as LogMessage);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(LogMessage other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Time != other.Time) return false;
if(!data_.Equals(other.data_)) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Time != 0L) hash ^= Time.GetHashCode();
hash ^= data_.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Time != 0L) {
output.WriteRawTag(8);
output.WriteInt64(Time);
}
data_.WriteTo(output, _repeated_data_codec);
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Time != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(Time);
}
size += data_.CalculateSize(_repeated_data_codec);
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(LogMessage other) {
if (other == null) {
return;
}
if (other.Time != 0L) {
Time = other.Time;
}
data_.Add(other.data_);
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
Time = input.ReadInt64();
break;
}
case 18: {
data_.AddEntriesFrom(input, _repeated_data_codec);
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: TraceSegmentService.proto
// </auto-generated>
#pragma warning disable 0414, 1591
#region Designer generated code
using grpc = global::Grpc.Core;
namespace SkyWalking.NetworkProtocol {
public static partial class TraceSegmentService
{
static readonly string __ServiceName = "TraceSegmentService";
static readonly grpc::Marshaller<global::SkyWalking.NetworkProtocol.UpstreamSegment> __Marshaller_UpstreamSegment = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::SkyWalking.NetworkProtocol.UpstreamSegment.Parser.ParseFrom);
static readonly grpc::Marshaller<global::SkyWalking.NetworkProtocol.Downstream> __Marshaller_Downstream = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::SkyWalking.NetworkProtocol.Downstream.Parser.ParseFrom);
static readonly grpc::Method<global::SkyWalking.NetworkProtocol.UpstreamSegment, global::SkyWalking.NetworkProtocol.Downstream> __Method_collect = new grpc::Method<global::SkyWalking.NetworkProtocol.UpstreamSegment, global::SkyWalking.NetworkProtocol.Downstream>(
grpc::MethodType.ClientStreaming,
__ServiceName,
"collect",
__Marshaller_UpstreamSegment,
__Marshaller_Downstream);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
{
get { return global::SkyWalking.NetworkProtocol.TraceSegmentServiceReflection.Descriptor.Services[0]; }
}
/// <summary>Base class for server-side implementations of TraceSegmentService</summary>
public abstract partial class TraceSegmentServiceBase
{
public virtual global::System.Threading.Tasks.Task<global::SkyWalking.NetworkProtocol.Downstream> collect(grpc::IAsyncStreamReader<global::SkyWalking.NetworkProtocol.UpstreamSegment> requestStream, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
}
/// <summary>Client for TraceSegmentService</summary>
public partial class TraceSegmentServiceClient : grpc::ClientBase<TraceSegmentServiceClient>
{
/// <summary>Creates a new client for TraceSegmentService</summary>
/// <param name="channel">The channel to use to make remote calls.</param>
public TraceSegmentServiceClient(grpc::Channel channel) : base(channel)
{
}
/// <summary>Creates a new client for TraceSegmentService that uses a custom <c>CallInvoker</c>.</summary>
/// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
public TraceSegmentServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker)
{
}
/// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
protected TraceSegmentServiceClient() : base()
{
}
/// <summary>Protected constructor to allow creation of configured clients.</summary>
/// <param name="configuration">The client configuration.</param>
protected TraceSegmentServiceClient(ClientBaseConfiguration configuration) : base(configuration)
{
}
public virtual grpc::AsyncClientStreamingCall<global::SkyWalking.NetworkProtocol.UpstreamSegment, global::SkyWalking.NetworkProtocol.Downstream> collect(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return collect(new grpc::CallOptions(headers, deadline, cancellationToken));
}
public virtual grpc::AsyncClientStreamingCall<global::SkyWalking.NetworkProtocol.UpstreamSegment, global::SkyWalking.NetworkProtocol.Downstream> collect(grpc::CallOptions options)
{
return CallInvoker.AsyncClientStreamingCall(__Method_collect, null, options);
}
/// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
protected override TraceSegmentServiceClient NewInstance(ClientBaseConfiguration configuration)
{
return new TraceSegmentServiceClient(configuration);
}
}
/// <summary>Creates service definition that can be registered with a server</summary>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static grpc::ServerServiceDefinition BindService(TraceSegmentServiceBase serviceImpl)
{
return grpc::ServerServiceDefinition.CreateBuilder()
.AddMethod(__Method_collect, serviceImpl.collect).Build();
}
}
}
#endregion
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\build\common.props" /> <Import Project="..\..\build\common.props" />
<PropertyGroup> <PropertyGroup>
...@@ -14,20 +14,7 @@ ...@@ -14,20 +14,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\SkyWalking.Abstractions\SkyWalking.Abstractions.csproj" /> <ProjectReference Include="..\SkyWalking.Abstractions\SkyWalking.Abstractions.csproj" />
</ItemGroup> <ProjectReference Include="..\SkyWalking.Transport.Grpc.Protocol\SkyWalking.Transport.Grpc.Protocol.csproj" />
<ItemGroup>
<Folder Include="NetworkProtocol" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Google.Protobuf" Version="3.6.1" />
<PackageReference Include="Google.Protobuf.Tools" Version="3.6.1" />
<PackageReference Include="Grpc" Version="1.17.0" />
<PackageReference Include="Grpc.Tools" Version="1.17.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup> </ItemGroup>
</Project> </Project>
/*
* Licensed to the OpenSkywalking 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.
*
*/
using System;
using System.Threading.Tasks;
using SkyWalking.Logging;
namespace SkyWalking.Transport.Grpc
{
internal class Call
{
private readonly ILogger _logger;
private readonly ConnectionManager _connectionManager;
public Call(ILogger logger, ConnectionManager connectionManager)
{
_logger = logger;
_connectionManager = connectionManager;
}
public async Task Execute(Func<Task> task, Func<string> errMessage)
{
try
{
await task();
}
catch (Exception ex)
{
_logger.Error(errMessage(), ex);
_connectionManager.Failure(ex);
}
}
public async Task<T> Execute<T>(Func<Task<T>> task, Func<T> errCallback, Func<string> errMessage)
{
try
{
return await task();
}
catch (Exception ex)
{
_logger.Error(errMessage(), ex);
_connectionManager.Failure(ex);
return errCallback();
}
}
}
}
\ No newline at end of file
...@@ -6,5 +6,9 @@ namespace SkyWalking.Transport.Grpc ...@@ -6,5 +6,9 @@ namespace SkyWalking.Transport.Grpc
public static readonly string RegisterApplicationInstanceError = "Register application instance fail."; public static readonly string RegisterApplicationInstanceError = "Register application instance fail.";
public static readonly string HeartbeatError = "Heartbeat fail."; public static readonly string HeartbeatError = "Heartbeat fail.";
public static readonly string CollectError = "Send trace segment fail."; public static readonly string CollectError = "Send trace segment fail.";
public static readonly string RegisterServiceError = "Register service fail.";
public static readonly string RegisterServiceInstanceError = "Register service instance fail.";
public static readonly string PingError = "Ping server fail.";
} }
} }
\ No newline at end of file
...@@ -21,15 +21,15 @@ using System.Threading; ...@@ -21,15 +21,15 @@ using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using SkyWalking.Logging; using SkyWalking.Logging;
namespace SkyWalking.Transport.Grpc namespace SkyWalking.Transport.Grpc.V6
{ {
public class GrpcStateCheckService : ExecutionService public class ConnectService: ExecutionService
{ {
private readonly ConnectionManager _connectionManager; private readonly ConnectionManager _connectionManager;
public GrpcStateCheckService(ConnectionManager connectionManager, ISkyWalkingClient skyWalking, IRuntimeEnvironment runtimeEnvironment, public ConnectService(ConnectionManager connectionManager,
ILoggerFactory loggerFactory) : base( IRuntimeEnvironment runtimeEnvironment,
skyWalking, runtimeEnvironment, loggerFactory) ILoggerFactory loggerFactory) : base(runtimeEnvironment, loggerFactory)
{ {
_connectionManager = connectionManager; _connectionManager = connectionManager;
} }
......
/*
* Licensed to the OpenSkywalking 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.
*
*/
using System;
using System.Threading;
using System.Threading.Tasks;
using SkyWalking.Config;
using SkyWalking.Logging;
using SkyWalking.NetworkProtocol;
namespace SkyWalking.Transport.Grpc.V6
{
public class PingCaller : IPingCaller
{
private readonly ConnectionManager _connectionManager;
private readonly ILogger _logger;
private readonly GrpcConfig _config;
public PingCaller(ConnectionManager connectionManager, ILoggerFactory loggerFactory,
IConfigAccessor configAccessor)
{
_connectionManager = connectionManager;
_config = configAccessor.Get<GrpcConfig>();
_logger = loggerFactory.CreateLogger(typeof(PingCaller));
}
public Task PingAsync(PingRequest request, CancellationToken cancellationToken = default(CancellationToken))
{
if (!_connectionManager.Ready)
{
return Task.CompletedTask;
}
var connection = _connectionManager.GetConnection();
return new Call(_logger, _connectionManager).Execute(async () =>
{
var client = new ServiceInstancePing.ServiceInstancePingClient(connection);
await client.doPingAsync(new ServiceInstancePingPkg
{
ServiceInstanceId = request.ServiceInstanceId,
ServiceInstanceUUID = request.InstanceId,
Time = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
}, null, _config.GetTimeout(), cancellationToken);
},
() => ExceptionHelpers.PingError);
}
}
}
\ No newline at end of file
/*
* Licensed to the OpenSkywalking under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenSkywalking 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.
*
*/
using System;
using System.Threading;
using System.Threading.Tasks;
using SkyWalking.Config;
using SkyWalking.Logging;
using SkyWalking.NetworkProtocol;
namespace SkyWalking.Transport.Grpc.V6
{
public class ServiceRegister : IServiceRegister
{
private const string OS_NAME = "os_name";
private const string HOST_NAME = "host_name";
private const string IPV4 = "ipv4";
private const string PROCESS_NO = "process_no";
private const string LANGUAGE = "language";
private readonly ConnectionManager _connectionManager;
private readonly ILogger _logger;
private readonly GrpcConfig _config;
public ServiceRegister(ConnectionManager connectionManager, IConfigAccessor configAccessor,
ILoggerFactory loggerFactory)
{
_connectionManager = connectionManager;
_config = configAccessor.Get<GrpcConfig>();
_logger = loggerFactory.CreateLogger(typeof(ServiceRegister));
}
public async Task<NullableValue> RegisterServiceAsync(ServiceRequest serviceRequest,
CancellationToken cancellationToken = default(CancellationToken))
{
if (!_connectionManager.Ready)
{
return NullableValue.Null;
}
var connection = _connectionManager.GetConnection();
return await new Call(_logger, _connectionManager).Execute(async () =>
{
var client = new Register.RegisterClient(connection);
var services = new Services();
services.Services_.Add(new Service
{
ServiceName = serviceRequest.ServiceName
});
var mapping = await client.doServiceRegisterAsync(services,
null, _config.GetTimeout(), cancellationToken);
foreach (var service in mapping.Services)
if (service.Key == serviceRequest.ServiceName)
return new NullableValue(service.Value);
return NullableValue.Null;
},
() => NullableValue.Null,
() => ExceptionHelpers.RegisterServiceError);
}
public async Task<NullableValue> RegisterServiceInstanceAsync(ServiceInstanceRequest serviceInstanceRequest,
CancellationToken cancellationToken = default(CancellationToken))
{
if (!_connectionManager.Ready)
{
return NullableValue.Null;
}
var connection = _connectionManager.GetConnection();
return await new Call(_logger, _connectionManager).Execute(async () =>
{
var client = new Register.RegisterClient(connection);
var instance = new ServiceInstance
{
ServiceId = serviceInstanceRequest.ServiceId,
InstanceUUID = serviceInstanceRequest.InstanceUUID,
Time = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
};
instance.Properties.Add(new KeyStringValuePair
{Key = OS_NAME, Value = serviceInstanceRequest.Properties.OsName});
instance.Properties.Add(new KeyStringValuePair
{Key = HOST_NAME, Value = serviceInstanceRequest.Properties.HostName});
instance.Properties.Add(new KeyStringValuePair
{Key = PROCESS_NO, Value = serviceInstanceRequest.Properties.ProcessNo.ToString()});
instance.Properties.Add(new KeyStringValuePair
{Key = LANGUAGE, Value = serviceInstanceRequest.Properties.Language});
foreach (var ip in serviceInstanceRequest.Properties.IpAddress)
instance.Properties.Add(new KeyStringValuePair
{Key = IPV4, Value = ip});
var serviceInstances = new ServiceInstances();
serviceInstances.Instances.Add(instance);
var mapping = await client.doServiceInstanceRegisterAsync(serviceInstances,
null, _config.GetTimeout(), cancellationToken);
foreach (var serviceInstance in mapping.ServiceInstances)
if (serviceInstance.Key == serviceInstanceRequest.InstanceUUID)
return new NullableValue(serviceInstance.Value);
return NullableValue.Null;
},
() => NullableValue.Null,
() => ExceptionHelpers.RegisterServiceInstanceError);
}
}
}
\ No newline at end of file
/*
* Licensed to the OpenSkywalking under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenSkywalking 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.
*
*/
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using SkyWalking.Config;
using SkyWalking.Logging;
using SkyWalking.NetworkProtocol;
namespace SkyWalking.Transport.Grpc.V6
{
public class TraceReporter : ITraceReporter
{
private readonly ConnectionManager _connectionManager;
private readonly ILogger _logger;
private readonly GrpcConfig _config;
public TraceReporter(ConnectionManager connectionManager, IConfigAccessor configAccessor,
ILoggerFactory loggerFactory)
{
_connectionManager = connectionManager;
_config = configAccessor.Get<GrpcConfig>();
_logger = loggerFactory.CreateLogger(typeof(TraceReporter));
}
public async Task ReportAsync(IReadOnlyCollection<TraceSegmentRequest> segmentRequests,
CancellationToken cancellationToken = default(CancellationToken))
{
if (!_connectionManager.Ready)
{
return;
}
var connection = _connectionManager.GetConnection();
try
{
var stopwatch = Stopwatch.StartNew();
var client = new TraceSegmentReportService.TraceSegmentReportServiceClient(connection);
using (var asyncClientStreamingCall =
client.collect(null, _config.GetReportTimeout(), cancellationToken))
{
foreach (var segment in segmentRequests)
await asyncClientStreamingCall.RequestStream.WriteAsync(TraceSegmentHelpers.Map(segment));
await asyncClientStreamingCall.RequestStream.CompleteAsync();
await asyncClientStreamingCall.ResponseAsync;
}
stopwatch.Stop();
_logger.Information($"Report {segmentRequests.Count} trace segment. cost: {stopwatch.Elapsed}s");
}
catch (Exception ex)
{
_logger.Error("Report trace segment fail.", ex);
_connectionManager.Failure(ex);
}
}
}
}
\ No newline at end of file
...@@ -30,7 +30,7 @@ namespace SkyWalking.Utilities.Configuration ...@@ -30,7 +30,7 @@ namespace SkyWalking.Utilities.Configuration
var defaultConfig = new Dictionary<string, string> var defaultConfig = new Dictionary<string, string>
{ {
{"SkyWalking:Namespace", string.Empty}, {"SkyWalking:Namespace", string.Empty},
{"SkyWalking:ApplicationCode", "My_Application"}, {"SkyWalking:ApplicationCode", "My_Service"},
{"SkyWalking:SpanLimitPerSegment", "300"}, {"SkyWalking:SpanLimitPerSegment", "300"},
{"SkyWalking:Sampling:SamplePer3Secs", "-1"}, {"SkyWalking:Sampling:SamplePer3Secs", "-1"},
{"SkyWalking:Logging:Level", "Information"}, {"SkyWalking:Logging:Level", "Information"},
...@@ -40,6 +40,7 @@ namespace SkyWalking.Utilities.Configuration ...@@ -40,6 +40,7 @@ namespace SkyWalking.Utilities.Configuration
{"SkyWalking:Transport:PendingSegmentTimeout", "1000"}, {"SkyWalking:Transport:PendingSegmentTimeout", "1000"},
{"SkyWalking:Transport:gRPC:Servers", "localhost:11800"}, {"SkyWalking:Transport:gRPC:Servers", "localhost:11800"},
{"SkyWalking:Transport:gRPC:Timeout", "2000"}, {"SkyWalking:Transport:gRPC:Timeout", "2000"},
{"SkyWalking:Transport:gRPC:ReportTimeout", "300000"},
{"SkyWalking:Transport:gRPC:ConnectTimeout", "10000"} {"SkyWalking:Transport:gRPC:ConnectTimeout", "10000"}
}; };
return builder.AddInMemoryCollection(defaultConfig); return builder.AddInMemoryCollection(defaultConfig);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment