ccat

package
v3.0.1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

* Copyright (c) 2011-2018, Meituan Dianping. All Rights Reserved. * * 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.

* Copyright (c) 2011-2018, Meituan Dianping. All Rights Reserved. * * 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.

* Copyright (c) 2011-2018, Meituan Dianping. All Rights Reserved. * * 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.

* Copyright (c) 2011-2018, Meituan Dianping. All Rights Reserved. * * 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.

Index

Constants

View Source
const (
	SUCCESS = "0"
	FAIL    = "-1"
)

Variables

This section is empty.

Functions

func Background

func Background()

func BuildConfig

func BuildConfig(
	encoderType,
	enableHeartbeat,
	enableSampling,
	enableDebugLog int,
) C.CatClientConfig

func Init

func Init(domain string)

func InitWithConfig

func InitWithConfig(domain string, _config C.CatClientConfig)

func LogEvent

func LogEvent(event *Event)

func LogMetricForCount

func LogMetricForCount(name string, count int)

func LogMetricForDuration

func LogMetricForDuration(name string, durationInNano int64)

func LogTransaction

func LogTransaction(trans *Transaction)

func Send

func Send(m Messager)

func Shutdown

func Shutdown()

func ShutdownAndWait

func ShutdownAndWait()

func Wait

func Wait()

Types

type Event

type Event struct {
	Message
}

func (*Event) Complete

func (e *Event) Complete()

type Flush

type Flush func(m Messager)

type Heartbeat

type Heartbeat struct {
	Message
}

func (*Heartbeat) Complete

func (e *Heartbeat) Complete()

type Message

type Message struct {
	Type   string
	Name   string
	Status string
	// contains filtered or unexported fields
}

func NewMessage

func NewMessage(mtype, name string, flush Flush) *Message

func (*Message) AddData

func (m *Message) AddData(k string, v ...string)

func (*Message) Complete

func (m *Message) Complete()

func (*Message) GetData

func (m *Message) GetData() *bytes.Buffer

func (*Message) GetTime

func (m *Message) GetTime() time.Time

func (*Message) GetTimestamp

func (m *Message) GetTimestamp() int64

func (*Message) SetStatus

func (m *Message) SetStatus(status string)

func (*Message) SetTimestamp

func (m *Message) SetTimestamp(timestampInNano int64)

type MessageGetter

type MessageGetter interface {
	GetData() *bytes.Buffer
	GetTime() time.Time
}

type Messager

type Messager interface {
	MessageGetter
	AddData(k string, v ...string)
	SetStatus(status string)
	Complete()
}

type Transaction

type Transaction struct {
	Message
	// contains filtered or unexported fields
}

func NewTransaction

func NewTransaction(mtype, name string, flush Flush) *Transaction

func (*Transaction) Complete

func (t *Transaction) Complete()

func (*Transaction) GetDuration

func (t *Transaction) GetDuration() int64

func (*Transaction) SetDuration

func (t *Transaction) SetDuration(durationInNano int64)

func (*Transaction) SetDurationStart

func (t *Transaction) SetDurationStart(durationStartInNano int64)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL