-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
api: add log,metric,span API to toolkit (#198)
- Loading branch information
Showing
4 changed files
with
147 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Licensed to 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. Apache Software Foundation (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. | ||
|
||
package log | ||
|
||
// Debug logs a message at DebugLevel | ||
func Debug(msg string, keyValues ...string) { | ||
|
||
} | ||
|
||
// Info logs a message at InfoLevel | ||
func Info(msg string, keyValues ...string) { | ||
|
||
} | ||
|
||
// Warn logs a message at DebugLevel | ||
func Warn(msg string, keyValues ...string) { | ||
|
||
} | ||
|
||
// Error logs a message at ErrorLevel | ||
func Error(msg string, keyValues ...string) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Licensed to 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. Apache Software Foundation (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. | ||
|
||
package metric | ||
|
||
// NewCounter creates a new counter metrics. | ||
func NewCounter(name string, opt ...MeterOpt) *CounterRef { | ||
return &CounterRef{} | ||
} | ||
|
||
// NewGauge creates a new gauge metrics. | ||
func NewGauge(name string, watcher func() float64, opts ...MeterOpt) *GaugeRef { | ||
return &GaugeRef{} | ||
} | ||
|
||
// NewHistogram creates a new histogram metrics. | ||
func NewHistogram(name string, steps []float64, opts ...MeterOpt) *Histogram { | ||
return &Histogram{} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// Licensed to 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. Apache Software Foundation (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. | ||
|
||
package metric | ||
|
||
type CounterRef struct{} | ||
|
||
// Get returns the current value of the counter. | ||
func (c *CounterRef) Get() float64 { | ||
return -1 | ||
} | ||
|
||
// Inc increments the counter with value. | ||
func (c *CounterRef) Inc(val float64) {} | ||
|
||
type GaugeRef struct { | ||
} | ||
|
||
// Get returns the current value of the gauge. | ||
func (g *GaugeRef) Get() float64 { | ||
return -1 | ||
} | ||
|
||
type Histogram struct { | ||
} | ||
|
||
// Observe find the value associate bucket and add 1. | ||
func (h *Histogram) Observe(val float64) { | ||
|
||
} | ||
|
||
// ObserveWithCount find the value associate bucket and add specific count. | ||
func (h *Histogram) ObserveWithCount(val float64, count int64) { | ||
|
||
} | ||
|
||
type MeterOpt struct { | ||
} | ||
|
||
// WithLabels Add labels for metric | ||
func WithLabels(key, val string) MeterOpt { | ||
return MeterOpt{} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters