feat: add open source statement
diff --git a/packages/dubbo-observable/src/index.ts b/packages/dubbo-observable/src/index.ts
index 2c753e1..16e8fe0 100644
--- a/packages/dubbo-observable/src/index.ts
+++ b/packages/dubbo-observable/src/index.ts
@@ -1,17 +1,19 @@
-// Copyright 2021-2023 Buf Technologies, Inc.
-//
-// Licensed 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.
-
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
export type { ObservableOptions, Observable } from "./observable.js";
export { createObservable } from "./observable.js";
diff --git a/packages/dubbo-observable/src/meter-collector.ts b/packages/dubbo-observable/src/meter-collector.ts
index b17a4b6..7b57d40 100644
--- a/packages/dubbo-observable/src/meter-collector.ts
+++ b/packages/dubbo-observable/src/meter-collector.ts
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
import type {
Attributes,
Counter,
@@ -7,9 +24,9 @@
MetricOptions,
ObservableCounter,
UpDownCounter,
-} from '@opentelemetry/api'
-import { metrics, ValueType } from '@opentelemetry/api';
-import { QpsCounter } from './qps-counter.js';
+} from "@opentelemetry/api"
+import { metrics, ValueType } from "@opentelemetry/api";
+import { QpsCounter } from "./qps-counter.js";
export { ValueType } from "@opentelemetry/api";
export type { MetricOptions } from "@opentelemetry/api";
@@ -126,7 +143,6 @@
* Service provider metrics collector
*/
export class ProviderMeterCollector extends MeterCollector {
-
/**
* The counter of total number of received requests by the provider
* @private
@@ -134,12 +150,18 @@
private providerRequestTotal: Counter | undefined;
/**
- * The counter of number of requests successfully received by the provider
+ * The counter of total number of successfully received requests by the provider
* @private
*/
private providerRequestSucceedTotal: Counter | undefined;
/**
+ * The counter of total number of unsuccessfully received requests by the provider
+ * @private
+ */
+ private providerRequestFailedTotal: Counter | undefined
+
+ /**
* The counter of number of requests received by the provider per second counter
* @private
*/
@@ -151,12 +173,6 @@
*/
private qpsCounter: QpsCounter | undefined;
- /**
- * Total counter of Failed Requests
- * @private
- */
- private providerRequestFailedTotal: Counter | undefined
-
constructor(options?: MeterCollectorOptions) {
super(options)
this.providerRequestTotal = this.getCounter("dubbo_provider_requests_total", {
@@ -166,13 +182,13 @@
this.providerRequestSucceedTotal =
this.getCounter("dubbo_provider_requests_succeed_total", {
- description: `The number of requests successfully received by the provider`,
+ description: `The total number of successfully received requests by the provider`,
valueType: ValueType.INT
});
this.providerRequestFailedTotal =
this.getCounter("dubbo_provider_requests_failed_total", {
- description: `Total Failed Requests`,
+ description: `The total number of unsuccessfully received requests by the provider`,
valueType: ValueType.INT
});
@@ -231,13 +247,25 @@
*/
export class ConsumerMeterCollector extends MeterCollector {
/**
- * The counter of total number of sent requests by consumers
+ * The counter of total number of received requests by the consumer
* @private
*/
private consumerRequestTotal: Counter | undefined;
/**
- * The counter of number of requests sent by consumers per second
+ * The counter of total number of successfully received requests by the consumer
+ * @private
+ */
+ private consumerRequestSucceedTotal: Counter | undefined;
+
+ /**
+ * The counter of total number of unsuccessfully received requests by the consumer
+ * @private
+ */
+ private consumerRequestFailedTotal: Counter | undefined
+
+ /**
+ * The counter of number of requests received by the consumer per second counter
* @private
*/
private consumerRequestQps: ObservableCounter | undefined;
@@ -248,38 +276,27 @@
*/
private qpsCounter: QpsCounter | undefined;
- /**
- * The counter of number of successful requests sent by consumers
- * @private
- */
- private consumerRequestSucceedTotal: Counter | undefined;
-
- /**
- * The counter of total Failed Requests.
- * @private
- */
- private consumerRequestFailedTotal: Counter | undefined
constructor(options?: MeterCollectorOptions) {
super(options)
this.consumerRequestTotal = this.getCounter("dubbo_consumer_requests_total", {
- description: `Total number of sent requests by consumers`,
+ description: `The total number of received requests by the consumer`,
valueType: ValueType.INT
});
this.consumerRequestSucceedTotal =
this.getCounter("dubbo_consumer_requests_succeed_total", {
- description: `The number of successful requests sent by consumers`,
+ description: `The total number of successfully received requests by the consumer`,
valueType: ValueType.INT
});
this.consumerRequestFailedTotal =
this.getCounter("dubbo_consumer_requests_failed_total", {
- description: `Total Failed Requests`,
+ description: `The total number of unsuccessfully received requests by the consumer`,
valueType: ValueType.INT
});
this.consumerRequestQps = this.getObservableCounter("dubbo_consumer_qps_total", {
- description: "The number of requests sent by consumers per second",
+ description: "The number of requests received by the consumer per second",
valueType: ValueType.INT
});
}
diff --git a/packages/dubbo-observable/src/observable.ts b/packages/dubbo-observable/src/observable.ts
index abe2614..14a723b 100644
--- a/packages/dubbo-observable/src/observable.ts
+++ b/packages/dubbo-observable/src/observable.ts
@@ -1,5 +1,22 @@
-import { NodeSDK } from '@opentelemetry/sdk-node';
-import type {NodeSDKConfiguration} from '@opentelemetry/sdk-node';
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { NodeSDK } from "@opentelemetry/sdk-node";
+import type { NodeSDKConfiguration } from "@opentelemetry/sdk-node";
export type ObservableOptions = {
/**
diff --git a/packages/dubbo-observable/src/qps-counter.ts b/packages/dubbo-observable/src/qps-counter.ts
index 4f92058..ab213ed 100644
--- a/packages/dubbo-observable/src/qps-counter.ts
+++ b/packages/dubbo-observable/src/qps-counter.ts
@@ -1,4 +1,19 @@
-
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
export class QpsCounter {
/**
@@ -48,7 +63,7 @@
* Total number of seconds from 00:00:00 Greenwich Mean Time on January 1, 1970 to now
*/
currentSecond() {
- return Math.floor(new Date().getTime()/1000);
+ return Math.floor(new Date().getTime() / 1000);
}
/**
diff --git a/packages/dubbo/src/protocol-grpc/gen/status_pb.ts b/packages/dubbo/src/protocol-grpc/gen/status_pb.ts
index 4e6962f..f26fcb5 100644
--- a/packages/dubbo/src/protocol-grpc/gen/status_pb.ts
+++ b/packages/dubbo/src/protocol-grpc/gen/status_pb.ts
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// @generated by protoc-gen-es v1.8.0 with parameter "target=ts"
+// @generated by protoc-gen-es v1.2.1 with parameter "target=ts"
// @generated from file status.proto (package google.rpc, syntax proto3)
/* eslint-disable */
// @ts-nocheck
diff --git a/packages/dubbo/src/protocol-triple/transport.ts b/packages/dubbo/src/protocol-triple/transport.ts
index 2aefecc..d308e43 100644
--- a/packages/dubbo/src/protocol-triple/transport.ts
+++ b/packages/dubbo/src/protocol-triple/transport.ts
@@ -55,12 +55,8 @@
import { createMethodSerializationLookup } from "../protocol/serialization.js";
import type { Transport } from "../transport.js";
import type { TripleClientServiceOptions } from './client-service-options.js';
-import {
- ConsumerMeterCollector,
- createObservable,
- type ObservableOptions
-} from '@apachedubbo/dubbo-observable';
-import type {Observable} from '@apachedubbo/dubbo-observable';
+import { ConsumerMeterCollector, createObservable } from '@apachedubbo/dubbo-observable';
+import type { Observable, ObservableOptions } from '@apachedubbo/dubbo-observable';
/**
* The Observable service instance.
@@ -75,7 +71,7 @@
if (!observable) {
observable = createObservable(observableOptions);
observable.start();
- //TODO: observable.shutdown()
+ // TODO: observable.shutdown()
}
}