Azure数据工厂.NET SDK活动指标 [英] Azure Data Factory .NET SDK activity metrics

查看:100
本文介绍了Azure数据工厂.NET SDK活动指标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道如何(或可能)访问Azure门户中详细信息下显示的每个活动的这些指标吗?

Does anyone know how to (or if it possible) to access these metrics for each activity run shown under "Details" in the Azure Portal?

最初的计划是使用.NET SDK,但似乎未包含这些指标。

The initial plan was to use the .NET SDK but none of these metrics seems to be included. This is what I have managed to find so far.

var datasliceRunListResponse = client.DataSliceRuns.List(
                _resourceGroupName,
                dataFactoryName,
                Dataset_Destination,
                new DataSliceRunListParameters()
                {
                    DataSliceStartTime = PipelineActivePeriodStartTime.ConvertToISO8601DateTimeString()
                }
            );

        foreach (DataSliceRun run in datasliceRunListResponse.DataSliceRuns)
        {
            Console.WriteLine("Status: \t\t{0}", run.Status);
            Console.WriteLine("DataSliceStart: \t{0}", run.DataSliceStart);
            Console.WriteLine("DataSliceEnd: \t\t{0}", run.DataSliceEnd);
            Console.WriteLine("ActivityId: \t\t{0}", run.ActivityName);
            Console.WriteLine("ProcessingStartTime: \t{0}", run.ProcessingStartTime);
            Console.WriteLine("ProcessingEndTime: \t{0}", run.ProcessingEndTime);
            Console.WriteLine("ErrorMessage: \t{0}", run.ErrorMessage);
            Console.WriteLine("Has logse: \t\t{0}", run.HasLogs.ToString());
            Console.WriteLine("Id: \t\t\t{0}", run.Id);
            Console.WriteLine("Log uri: \t{0}", run.LogUri);
            Console.WriteLine("Properties: \t{0}", run.Properties.Count);

        }


推荐答案

挖掘我在.NET SDK中找到了解决方案。您需要执行两步获取。

After some digging I found the solution in the .NET SDK. You need to do a "two step fetch".

获取切片详细信息

DateTime PipelineActivePeriodStartTime;
    DataSliceRunListResponse sliceList = new DataSliceRunListResponse();
    DataSliceRunGetResponse sliceResponse = new DataSliceRunGetResponse();
    PipelineActivePeriodStartTime = new DateTime(2017, 3, 20, 07, 00, 0, 0, DateTimeKind.Utc);

    DataFactoryManagementClient client = new DataFactoryManagementClient(_aadTokenCredentials, _resourceManagerUri);

    sliceList = client.DataSliceRuns.List(
                _resourceGroupName,
                _dataFactoryName,
                _datasetDestination,
                new DataSliceRunListParameters()
                {
                    DataSliceStartTime = PipelineActivePeriodStartTime.ConvertToISO8601DateTimeString()
                }
    );

    foreach (DataSliceRun run in sliceList.DataSliceRuns)
    {
        sliceResponse = client.DataSliceRuns.Get(_resourceGroupName, dataFactoryName, run.Id.ToString());

        foreach (KeyValuePair<string, string> entry in sliceResponse.DataSliceRun.Properties)
        {
            switch (entry.Key.Trim())
            {
                case "rows":
                    rows = Convert.ToInt32(entry.Value);
                    break;
                case "dataRead":
                    dataRead = entry.Value;
                    break;
                case "dataWritten":
                    dataWritten = entry.Value;
                    break;
                case "throughput":
                    throughtput = entry.Value;
                    break;
                case "totalDuration":
                    totalDuration = entry.Value;
                    break;
                default:
                    break;
            }
        }
    }

这篇关于Azure数据工厂.NET SDK活动指标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆