// 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 nativeclr

import (
	"context"

	common "skywalking.apache.org/repo/goapi/collect/common/v3"
	agent "skywalking.apache.org/repo/goapi/collect/language/agent/v3"
	agent_compat "skywalking.apache.org/repo/goapi/collect/language/agent/v3/compat"
)

type CLRReportServiceCompat struct {
	reportService *CLRReportService
	agent_compat.UnimplementedCLRMetricReportServiceServer
}

func (j *CLRReportServiceCompat) Collect(ctx context.Context, clr *agent.CLRMetricCollection) (*common.Commands, error) {
	return j.reportService.Collect(ctx, clr)
}
