Move test-related modules to test/modules; and remove ModuleUtil dependencies from TempSensor and MetricsCollector.
This commit is contained in:
Philip Lin 2019-12-30 10:11:21 -08:00 коммит произвёл GitHub
Родитель a2cbc51f1a
Коммит 9772c40da2
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
131 изменённых файлов: 369 добавлений и 305 удалений

Просмотреть файл

@ -88,8 +88,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.Devices.Edg
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.Devices.Edge.Hub.Http.Test", "edge-hub\test\Microsoft.Azure.Devices.Edge.Hub.Http.Test\Microsoft.Azure.Devices.Edge.Hub.Http.Test.csproj", "{E4239B7F-1FDB-4034-8FD7-E9486CA091A4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TemperatureFilter", "edge-modules\TemperatureFilter\TemperatureFilter.csproj", "{D67D382A-5F16-4AB2-8082-DBE62C33E5B1}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "functions", "functions", "{C4502187-81D7-4299-85C3-64AE241503E0}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{1ABF19EE-7689-4EE3-A099-16111A8F16F4}"
@ -152,10 +150,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.Devices.Edg
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.Devices.Edge.Agent.Edgelet.Docker.Test", "edge-agent\test\Microsoft.Azure.Devices.Edge.Agent.Edgelet.Docker.Test\Microsoft.Azure.Devices.Edge.Agent.Edgelet.Docker.Test.csproj", "{79E573DB-A6A8-4F6F-B5A0-DA2258EB82E6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "load-gen", "edge-modules\load-gen\load-gen.csproj", "{54771470-860C-4853-9318-6DB4EA76B595}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestAnalyzer", "edge-modules\TestAnalyzer\TestAnalyzer.csproj", "{047DC795-A159-4BFF-AC0F-4DCE51A79C2C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LeafDevice", "smoke\LeafDevice\LeafDevice.csproj", "{C5CBC493-96A4-4628-A952-8C7B9EEF1441}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.WebJobs.Extensions.EdgeHub", "edge-modules\functions\binding\src\Microsoft.Azure.WebJobs.Extensions.EdgeHub\Microsoft.Azure.WebJobs.Extensions.EdgeHub.csproj", "{0D5C5996-7414-47D2-AF0F-C68E0E3F3AA4}"
@ -166,12 +160,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EdgeHubTriggerCSharp", "edg
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.Devices.Edge.Hub.Service.Test", "edge-hub\test\Microsoft.Azure.Devices.Edge.Hub.Service.Test\Microsoft.Azure.Devices.Edge.Hub.Service.Test.csproj", "{9BED8F14-63E9-4B4B-88F7-659D5E522CBD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DirectMethodSender", "edge-modules\DirectMethodSender\DirectMethodSender.csproj", "{029174D7-588D-4D29-BF3D-4A414B070C39}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DirectMethodReceiver", "edge-modules\DirectMethodReceiver\DirectMethodReceiver.csproj", "{013D53C7-3AB5-41A4-9A8D-0F2C47238773}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.Devices.Edge.ModuleUtil", "edge-modules\ModuleLib\Microsoft.Azure.Devices.Edge.ModuleUtil.csproj", "{A58633ED-5302-41DF-A0F6-FDC48E5C6B04}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{2300ED4C-1D5A-460F-8691-7C85E1162E0C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.Devices.Edge.Test.Common", "test\Microsoft.Azure.Devices.Edge.Test.Common\Microsoft.Azure.Devices.Edge.Test.Common.csproj", "{950DACB0-B011-41AF-B0FB-245F749B01AB}"
@ -193,14 +181,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.Devices.Edg
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.Devices.Edge.Agent.Kubernetes.IntegrationTest", "edge-agent\test\Microsoft.Azure.Devices.Edge.Agent.Kubernetes.IntegrationTest\Microsoft.Azure.Devices.Edge.Agent.Kubernetes.IntegrationTest.csproj", "{79540E35-45EA-4568-9AB7-C1CC0BFF73EE}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "edge-modules", "edge-modules", "{69157D2B-2AD3-4EE0-A837-6AD9329EDDC3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TwinTester", "edge-modules\TwinTester\TwinTester.csproj", "{9237E577-DD0B-4A49-8155-7BC8635F9DBD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ModuleRestarter", "edge-modules\ModuleRestarter\ModuleRestarter.csproj", "{2C7AE89A-648C-4EBC-8084-0E59BAFF496D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Relayer", "edge-modules\Relayer\Relayer.csproj", "{C1FDA6CF-7EF6-4C3F-81E7-4C13EE399BF1}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "modules", "modules", "{F921339B-32F9-4BF3-B364-2DB01FA2F1A1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestResultCoordinator", "test\modules\TestResultCoordinator\TestResultCoordinator.csproj", "{8181EB49-62CE-495B-8078-08DCF8C30541}"
@ -211,7 +191,23 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetworkController", "test\c
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Modules.Test", "test\modules\Modules.Test\Modules.Test.csproj", "{837F5563-BB1C-4A59-A506-07ED8458DB4E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MetricsCollector", "edge-modules\MetricsCollector\MetricsCollector.csproj", "{4B0F95CF-E696-450F-B7F6-35E361C91777}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MetricsCollector", "edge-modules\MetricsCollector\MetricsCollector.csproj", "{4B0F95CF-E696-450F-B7F6-35E361C91777}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DirectMethodReceiver", "test\modules\DirectMethodReceiver\DirectMethodReceiver.csproj", "{8C964A2F-A163-421C-B262-BE9C81B555BC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DirectMethodSender", "test\modules\DirectMethodSender\DirectMethodSender.csproj", "{57E3932B-639B-4ED5-BC31-9422EB8D842E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "load-gen", "test\modules\load-gen\load-gen.csproj", "{C0DFD8A9-EE39-48CA-A458-1403382671C9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.Devices.Edge.ModuleUtil", "test\modules\ModuleLib\Microsoft.Azure.Devices.Edge.ModuleUtil.csproj", "{6458DBFC-38D5-4784-B92A-A1174D2469B4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ModuleRestarter", "test\modules\ModuleRestarter\ModuleRestarter.csproj", "{3E914549-08C2-4A19-B699-8B707A10A9B0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Relayer", "test\modules\Relayer\Relayer.csproj", "{5918F481-0BE6-4D3F-95EB-34D30C9412DC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TemperatureFilter", "test\modules\TemperatureFilter\TemperatureFilter.csproj", "{E6510C48-92B8-4995-A5C5-CBCB98029863}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestAnalyzer", "test\modules\TestAnalyzer\TestAnalyzer.csproj", "{6208102C-151C-45CE-B573-B9C15B551B4D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -413,14 +409,6 @@ Global
{E4239B7F-1FDB-4034-8FD7-E9486CA091A4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E4239B7F-1FDB-4034-8FD7-E9486CA091A4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E4239B7F-1FDB-4034-8FD7-E9486CA091A4}.Release|Any CPU.Build.0 = Release|Any CPU
{D67D382A-5F16-4AB2-8082-DBE62C33E5B1}.CheckInBuild|Any CPU.ActiveCfg = CheckInBuild|Any CPU
{D67D382A-5F16-4AB2-8082-DBE62C33E5B1}.CheckInBuild|Any CPU.Build.0 = CheckInBuild|Any CPU
{D67D382A-5F16-4AB2-8082-DBE62C33E5B1}.CodeCoverage|Any CPU.ActiveCfg = CodeCoverage|Any CPU
{D67D382A-5F16-4AB2-8082-DBE62C33E5B1}.CodeCoverage|Any CPU.Build.0 = CodeCoverage|Any CPU
{D67D382A-5F16-4AB2-8082-DBE62C33E5B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D67D382A-5F16-4AB2-8082-DBE62C33E5B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D67D382A-5F16-4AB2-8082-DBE62C33E5B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D67D382A-5F16-4AB2-8082-DBE62C33E5B1}.Release|Any CPU.Build.0 = Release|Any CPU
{DB92F6C3-A611-40C5-B464-8F11A3EE1AC3}.CheckInBuild|Any CPU.ActiveCfg = CheckInBuild|Any CPU
{DB92F6C3-A611-40C5-B464-8F11A3EE1AC3}.CheckInBuild|Any CPU.Build.0 = CheckInBuild|Any CPU
{DB92F6C3-A611-40C5-B464-8F11A3EE1AC3}.CodeCoverage|Any CPU.ActiveCfg = CodeCoverage|Any CPU
@ -509,22 +497,6 @@ Global
{79E573DB-A6A8-4F6F-B5A0-DA2258EB82E6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{79E573DB-A6A8-4F6F-B5A0-DA2258EB82E6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{79E573DB-A6A8-4F6F-B5A0-DA2258EB82E6}.Release|Any CPU.Build.0 = Release|Any CPU
{54771470-860C-4853-9318-6DB4EA76B595}.CheckInBuild|Any CPU.ActiveCfg = CheckInBuild|Any CPU
{54771470-860C-4853-9318-6DB4EA76B595}.CheckInBuild|Any CPU.Build.0 = CheckInBuild|Any CPU
{54771470-860C-4853-9318-6DB4EA76B595}.CodeCoverage|Any CPU.ActiveCfg = Debug|Any CPU
{54771470-860C-4853-9318-6DB4EA76B595}.CodeCoverage|Any CPU.Build.0 = Debug|Any CPU
{54771470-860C-4853-9318-6DB4EA76B595}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{54771470-860C-4853-9318-6DB4EA76B595}.Debug|Any CPU.Build.0 = Debug|Any CPU
{54771470-860C-4853-9318-6DB4EA76B595}.Release|Any CPU.ActiveCfg = Release|Any CPU
{54771470-860C-4853-9318-6DB4EA76B595}.Release|Any CPU.Build.0 = Release|Any CPU
{047DC795-A159-4BFF-AC0F-4DCE51A79C2C}.CheckInBuild|Any CPU.ActiveCfg = CheckInBuild|Any CPU
{047DC795-A159-4BFF-AC0F-4DCE51A79C2C}.CheckInBuild|Any CPU.Build.0 = CheckInBuild|Any CPU
{047DC795-A159-4BFF-AC0F-4DCE51A79C2C}.CodeCoverage|Any CPU.ActiveCfg = Debug|Any CPU
{047DC795-A159-4BFF-AC0F-4DCE51A79C2C}.CodeCoverage|Any CPU.Build.0 = Debug|Any CPU
{047DC795-A159-4BFF-AC0F-4DCE51A79C2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{047DC795-A159-4BFF-AC0F-4DCE51A79C2C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{047DC795-A159-4BFF-AC0F-4DCE51A79C2C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{047DC795-A159-4BFF-AC0F-4DCE51A79C2C}.Release|Any CPU.Build.0 = Release|Any CPU
{C5CBC493-96A4-4628-A952-8C7B9EEF1441}.CheckInBuild|Any CPU.ActiveCfg = CheckInBuild|Any CPU
{C5CBC493-96A4-4628-A952-8C7B9EEF1441}.CheckInBuild|Any CPU.Build.0 = CheckInBuild|Any CPU
{C5CBC493-96A4-4628-A952-8C7B9EEF1441}.CodeCoverage|Any CPU.ActiveCfg = CodeCoverage|Any CPU
@ -557,30 +529,6 @@ Global
{9BED8F14-63E9-4B4B-88F7-659D5E522CBD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9BED8F14-63E9-4B4B-88F7-659D5E522CBD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9BED8F14-63E9-4B4B-88F7-659D5E522CBD}.Release|Any CPU.Build.0 = Release|Any CPU
{029174D7-588D-4D29-BF3D-4A414B070C39}.CheckInBuild|Any CPU.ActiveCfg = CheckInBuild|Any CPU
{029174D7-588D-4D29-BF3D-4A414B070C39}.CheckInBuild|Any CPU.Build.0 = CheckInBuild|Any CPU
{029174D7-588D-4D29-BF3D-4A414B070C39}.CodeCoverage|Any CPU.ActiveCfg = CodeCoverage|Any CPU
{029174D7-588D-4D29-BF3D-4A414B070C39}.CodeCoverage|Any CPU.Build.0 = CodeCoverage|Any CPU
{029174D7-588D-4D29-BF3D-4A414B070C39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{029174D7-588D-4D29-BF3D-4A414B070C39}.Debug|Any CPU.Build.0 = Debug|Any CPU
{029174D7-588D-4D29-BF3D-4A414B070C39}.Release|Any CPU.ActiveCfg = Release|Any CPU
{029174D7-588D-4D29-BF3D-4A414B070C39}.Release|Any CPU.Build.0 = Release|Any CPU
{013D53C7-3AB5-41A4-9A8D-0F2C47238773}.CheckInBuild|Any CPU.ActiveCfg = CheckInBuild|Any CPU
{013D53C7-3AB5-41A4-9A8D-0F2C47238773}.CheckInBuild|Any CPU.Build.0 = CheckInBuild|Any CPU
{013D53C7-3AB5-41A4-9A8D-0F2C47238773}.CodeCoverage|Any CPU.ActiveCfg = CodeCoverage|Any CPU
{013D53C7-3AB5-41A4-9A8D-0F2C47238773}.CodeCoverage|Any CPU.Build.0 = CodeCoverage|Any CPU
{013D53C7-3AB5-41A4-9A8D-0F2C47238773}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{013D53C7-3AB5-41A4-9A8D-0F2C47238773}.Debug|Any CPU.Build.0 = Debug|Any CPU
{013D53C7-3AB5-41A4-9A8D-0F2C47238773}.Release|Any CPU.ActiveCfg = Release|Any CPU
{013D53C7-3AB5-41A4-9A8D-0F2C47238773}.Release|Any CPU.Build.0 = Release|Any CPU
{A58633ED-5302-41DF-A0F6-FDC48E5C6B04}.CheckInBuild|Any CPU.ActiveCfg = CheckInBuild|Any CPU
{A58633ED-5302-41DF-A0F6-FDC48E5C6B04}.CheckInBuild|Any CPU.Build.0 = CheckInBuild|Any CPU
{A58633ED-5302-41DF-A0F6-FDC48E5C6B04}.CodeCoverage|Any CPU.ActiveCfg = Debug|Any CPU
{A58633ED-5302-41DF-A0F6-FDC48E5C6B04}.CodeCoverage|Any CPU.Build.0 = Debug|Any CPU
{A58633ED-5302-41DF-A0F6-FDC48E5C6B04}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A58633ED-5302-41DF-A0F6-FDC48E5C6B04}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A58633ED-5302-41DF-A0F6-FDC48E5C6B04}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A58633ED-5302-41DF-A0F6-FDC48E5C6B04}.Release|Any CPU.Build.0 = Release|Any CPU
{950DACB0-B011-41AF-B0FB-245F749B01AB}.CheckInBuild|Any CPU.ActiveCfg = CheckInBuild|Any CPU
{950DACB0-B011-41AF-B0FB-245F749B01AB}.CheckInBuild|Any CPU.Build.0 = CheckInBuild|Any CPU
{950DACB0-B011-41AF-B0FB-245F749B01AB}.CodeCoverage|Any CPU.ActiveCfg = Debug|Any CPU
@ -637,30 +585,6 @@ Global
{79540E35-45EA-4568-9AB7-C1CC0BFF73EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{79540E35-45EA-4568-9AB7-C1CC0BFF73EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{79540E35-45EA-4568-9AB7-C1CC0BFF73EE}.Release|Any CPU.Build.0 = Release|Any CPU
{9237E577-DD0B-4A49-8155-7BC8635F9DBD}.CheckInBuild|Any CPU.ActiveCfg = CheckInBuild|Any CPU
{9237E577-DD0B-4A49-8155-7BC8635F9DBD}.CheckInBuild|Any CPU.Build.0 = CheckInBuild|Any CPU
{9237E577-DD0B-4A49-8155-7BC8635F9DBD}.CodeCoverage|Any CPU.ActiveCfg = Debug|Any CPU
{9237E577-DD0B-4A49-8155-7BC8635F9DBD}.CodeCoverage|Any CPU.Build.0 = Debug|Any CPU
{9237E577-DD0B-4A49-8155-7BC8635F9DBD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9237E577-DD0B-4A49-8155-7BC8635F9DBD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9237E577-DD0B-4A49-8155-7BC8635F9DBD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9237E577-DD0B-4A49-8155-7BC8635F9DBD}.Release|Any CPU.Build.0 = Release|Any CPU
{2C7AE89A-648C-4EBC-8084-0E59BAFF496D}.CheckInBuild|Any CPU.ActiveCfg = CheckInBuild|Any CPU
{2C7AE89A-648C-4EBC-8084-0E59BAFF496D}.CheckInBuild|Any CPU.Build.0 = CheckInBuild|Any CPU
{2C7AE89A-648C-4EBC-8084-0E59BAFF496D}.CodeCoverage|Any CPU.ActiveCfg = CodeCoverage|Any CPU
{2C7AE89A-648C-4EBC-8084-0E59BAFF496D}.CodeCoverage|Any CPU.Build.0 = CodeCoverage|Any CPU
{2C7AE89A-648C-4EBC-8084-0E59BAFF496D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2C7AE89A-648C-4EBC-8084-0E59BAFF496D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2C7AE89A-648C-4EBC-8084-0E59BAFF496D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2C7AE89A-648C-4EBC-8084-0E59BAFF496D}.Release|Any CPU.Build.0 = Release|Any CPU
{C1FDA6CF-7EF6-4C3F-81E7-4C13EE399BF1}.CheckInBuild|Any CPU.ActiveCfg = CheckInBuild|Any CPU
{C1FDA6CF-7EF6-4C3F-81E7-4C13EE399BF1}.CheckInBuild|Any CPU.Build.0 = CheckInBuild|Any CPU
{C1FDA6CF-7EF6-4C3F-81E7-4C13EE399BF1}.CodeCoverage|Any CPU.ActiveCfg = Debug|Any CPU
{C1FDA6CF-7EF6-4C3F-81E7-4C13EE399BF1}.CodeCoverage|Any CPU.Build.0 = Debug|Any CPU
{C1FDA6CF-7EF6-4C3F-81E7-4C13EE399BF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C1FDA6CF-7EF6-4C3F-81E7-4C13EE399BF1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C1FDA6CF-7EF6-4C3F-81E7-4C13EE399BF1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C1FDA6CF-7EF6-4C3F-81E7-4C13EE399BF1}.Release|Any CPU.Build.0 = Release|Any CPU
{8181EB49-62CE-495B-8078-08DCF8C30541}.CheckInBuild|Any CPU.ActiveCfg = Debug|Any CPU
{8181EB49-62CE-495B-8078-08DCF8C30541}.CheckInBuild|Any CPU.Build.0 = Debug|Any CPU
{8181EB49-62CE-495B-8078-08DCF8C30541}.CodeCoverage|Any CPU.ActiveCfg = Debug|Any CPU
@ -693,6 +617,70 @@ Global
{4B0F95CF-E696-450F-B7F6-35E361C91777}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4B0F95CF-E696-450F-B7F6-35E361C91777}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4B0F95CF-E696-450F-B7F6-35E361C91777}.Release|Any CPU.Build.0 = Release|Any CPU
{8C964A2F-A163-421C-B262-BE9C81B555BC}.CheckInBuild|Any CPU.ActiveCfg = CheckInBuild|Any CPU
{8C964A2F-A163-421C-B262-BE9C81B555BC}.CheckInBuild|Any CPU.Build.0 = CheckInBuild|Any CPU
{8C964A2F-A163-421C-B262-BE9C81B555BC}.CodeCoverage|Any CPU.ActiveCfg = CodeCoverage|Any CPU
{8C964A2F-A163-421C-B262-BE9C81B555BC}.CodeCoverage|Any CPU.Build.0 = CodeCoverage|Any CPU
{8C964A2F-A163-421C-B262-BE9C81B555BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8C964A2F-A163-421C-B262-BE9C81B555BC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8C964A2F-A163-421C-B262-BE9C81B555BC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8C964A2F-A163-421C-B262-BE9C81B555BC}.Release|Any CPU.Build.0 = Release|Any CPU
{57E3932B-639B-4ED5-BC31-9422EB8D842E}.CheckInBuild|Any CPU.ActiveCfg = CheckInBuild|Any CPU
{57E3932B-639B-4ED5-BC31-9422EB8D842E}.CheckInBuild|Any CPU.Build.0 = CheckInBuild|Any CPU
{57E3932B-639B-4ED5-BC31-9422EB8D842E}.CodeCoverage|Any CPU.ActiveCfg = CodeCoverage|Any CPU
{57E3932B-639B-4ED5-BC31-9422EB8D842E}.CodeCoverage|Any CPU.Build.0 = CodeCoverage|Any CPU
{57E3932B-639B-4ED5-BC31-9422EB8D842E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{57E3932B-639B-4ED5-BC31-9422EB8D842E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{57E3932B-639B-4ED5-BC31-9422EB8D842E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{57E3932B-639B-4ED5-BC31-9422EB8D842E}.Release|Any CPU.Build.0 = Release|Any CPU
{C0DFD8A9-EE39-48CA-A458-1403382671C9}.CheckInBuild|Any CPU.ActiveCfg = CheckInBuild|Any CPU
{C0DFD8A9-EE39-48CA-A458-1403382671C9}.CheckInBuild|Any CPU.Build.0 = CheckInBuild|Any CPU
{C0DFD8A9-EE39-48CA-A458-1403382671C9}.CodeCoverage|Any CPU.ActiveCfg = CheckInBuild|Any CPU
{C0DFD8A9-EE39-48CA-A458-1403382671C9}.CodeCoverage|Any CPU.Build.0 = CheckInBuild|Any CPU
{C0DFD8A9-EE39-48CA-A458-1403382671C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C0DFD8A9-EE39-48CA-A458-1403382671C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C0DFD8A9-EE39-48CA-A458-1403382671C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C0DFD8A9-EE39-48CA-A458-1403382671C9}.Release|Any CPU.Build.0 = Release|Any CPU
{6458DBFC-38D5-4784-B92A-A1174D2469B4}.CheckInBuild|Any CPU.ActiveCfg = CheckInBuild|Any CPU
{6458DBFC-38D5-4784-B92A-A1174D2469B4}.CheckInBuild|Any CPU.Build.0 = CheckInBuild|Any CPU
{6458DBFC-38D5-4784-B92A-A1174D2469B4}.CodeCoverage|Any CPU.ActiveCfg = CheckInBuild|Any CPU
{6458DBFC-38D5-4784-B92A-A1174D2469B4}.CodeCoverage|Any CPU.Build.0 = CheckInBuild|Any CPU
{6458DBFC-38D5-4784-B92A-A1174D2469B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6458DBFC-38D5-4784-B92A-A1174D2469B4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6458DBFC-38D5-4784-B92A-A1174D2469B4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6458DBFC-38D5-4784-B92A-A1174D2469B4}.Release|Any CPU.Build.0 = Release|Any CPU
{3E914549-08C2-4A19-B699-8B707A10A9B0}.CheckInBuild|Any CPU.ActiveCfg = CheckInBuild|Any CPU
{3E914549-08C2-4A19-B699-8B707A10A9B0}.CheckInBuild|Any CPU.Build.0 = CheckInBuild|Any CPU
{3E914549-08C2-4A19-B699-8B707A10A9B0}.CodeCoverage|Any CPU.ActiveCfg = CodeCoverage|Any CPU
{3E914549-08C2-4A19-B699-8B707A10A9B0}.CodeCoverage|Any CPU.Build.0 = CodeCoverage|Any CPU
{3E914549-08C2-4A19-B699-8B707A10A9B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3E914549-08C2-4A19-B699-8B707A10A9B0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3E914549-08C2-4A19-B699-8B707A10A9B0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3E914549-08C2-4A19-B699-8B707A10A9B0}.Release|Any CPU.Build.0 = Release|Any CPU
{5918F481-0BE6-4D3F-95EB-34D30C9412DC}.CheckInBuild|Any CPU.ActiveCfg = CheckInBuild|Any CPU
{5918F481-0BE6-4D3F-95EB-34D30C9412DC}.CheckInBuild|Any CPU.Build.0 = CheckInBuild|Any CPU
{5918F481-0BE6-4D3F-95EB-34D30C9412DC}.CodeCoverage|Any CPU.ActiveCfg = CheckInBuild|Any CPU
{5918F481-0BE6-4D3F-95EB-34D30C9412DC}.CodeCoverage|Any CPU.Build.0 = CheckInBuild|Any CPU
{5918F481-0BE6-4D3F-95EB-34D30C9412DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5918F481-0BE6-4D3F-95EB-34D30C9412DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5918F481-0BE6-4D3F-95EB-34D30C9412DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5918F481-0BE6-4D3F-95EB-34D30C9412DC}.Release|Any CPU.Build.0 = Release|Any CPU
{E6510C48-92B8-4995-A5C5-CBCB98029863}.CheckInBuild|Any CPU.ActiveCfg = CheckInBuild|Any CPU
{E6510C48-92B8-4995-A5C5-CBCB98029863}.CheckInBuild|Any CPU.Build.0 = CheckInBuild|Any CPU
{E6510C48-92B8-4995-A5C5-CBCB98029863}.CodeCoverage|Any CPU.ActiveCfg = CodeCoverage|Any CPU
{E6510C48-92B8-4995-A5C5-CBCB98029863}.CodeCoverage|Any CPU.Build.0 = CodeCoverage|Any CPU
{E6510C48-92B8-4995-A5C5-CBCB98029863}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E6510C48-92B8-4995-A5C5-CBCB98029863}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E6510C48-92B8-4995-A5C5-CBCB98029863}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E6510C48-92B8-4995-A5C5-CBCB98029863}.Release|Any CPU.Build.0 = Release|Any CPU
{6208102C-151C-45CE-B573-B9C15B551B4D}.CheckInBuild|Any CPU.ActiveCfg = CheckInBuild|Any CPU
{6208102C-151C-45CE-B573-B9C15B551B4D}.CheckInBuild|Any CPU.Build.0 = CheckInBuild|Any CPU
{6208102C-151C-45CE-B573-B9C15B551B4D}.CodeCoverage|Any CPU.ActiveCfg = CheckInBuild|Any CPU
{6208102C-151C-45CE-B573-B9C15B551B4D}.CodeCoverage|Any CPU.Build.0 = CheckInBuild|Any CPU
{6208102C-151C-45CE-B573-B9C15B551B4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6208102C-151C-45CE-B573-B9C15B551B4D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6208102C-151C-45CE-B573-B9C15B551B4D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6208102C-151C-45CE-B573-B9C15B551B4D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -728,7 +716,6 @@ Global
{592F8A5A-B1C7-4011-9879-B2AEE118DD3F} = {578D5330-2F72-44C6-9DB5-C93B3F42C473}
{16C92EBE-CB81-4980-8927-590CA5D5A97E} = {AB4285D8-CF1D-4B20-95F6-CB80892C8321}
{E4239B7F-1FDB-4034-8FD7-E9486CA091A4} = {63969606-14B2-4D9D-AB72-A5D60D22037C}
{D67D382A-5F16-4AB2-8082-DBE62C33E5B1} = {578D5330-2F72-44C6-9DB5-C93B3F42C473}
{C4502187-81D7-4299-85C3-64AE241503E0} = {578D5330-2F72-44C6-9DB5-C93B3F42C473}
{1ABF19EE-7689-4EE3-A099-16111A8F16F4} = {B8B03013-8D6E-4D4E-9914-33D55074DEC8}
{B8B03013-8D6E-4D4E-9914-33D55074DEC8} = {C4502187-81D7-4299-85C3-64AE241503E0}
@ -750,16 +737,11 @@ Global
{77CF0F04-0DE0-4D81-93DE-56006D7BE213} = {F5E37327-3AA9-4CC2-9FE3-B28271ADB5E3}
{F8253E40-6EE0-4FFA-BF39-D133A504175E} = {54351E51-19CB-4DE3-8302-99846AB216CF}
{79E573DB-A6A8-4F6F-B5A0-DA2258EB82E6} = {F5E37327-3AA9-4CC2-9FE3-B28271ADB5E3}
{54771470-860C-4853-9318-6DB4EA76B595} = {578D5330-2F72-44C6-9DB5-C93B3F42C473}
{047DC795-A159-4BFF-AC0F-4DCE51A79C2C} = {578D5330-2F72-44C6-9DB5-C93B3F42C473}
{C5CBC493-96A4-4628-A952-8C7B9EEF1441} = {871A0862-7480-49C3-ACEB-9A60E9CE5B61}
{0D5C5996-7414-47D2-AF0F-C68E0E3F3AA4} = {1ABF19EE-7689-4EE3-A099-16111A8F16F4}
{C3BDC9FA-B7D8-44F3-970F-D24281335F46} = {33B7755E-D6F9-4F9B-86A8-5DFE9FEE674E}
{B8D5312A-B37B-4FA3-8B80-2D1A93077DDF} = {C3BDC9FA-B7D8-44F3-970F-D24281335F46}
{9BED8F14-63E9-4B4B-88F7-659D5E522CBD} = {63969606-14B2-4D9D-AB72-A5D60D22037C}
{029174D7-588D-4D29-BF3D-4A414B070C39} = {578D5330-2F72-44C6-9DB5-C93B3F42C473}
{013D53C7-3AB5-41A4-9A8D-0F2C47238773} = {578D5330-2F72-44C6-9DB5-C93B3F42C473}
{A58633ED-5302-41DF-A0F6-FDC48E5C6B04} = {578D5330-2F72-44C6-9DB5-C93B3F42C473}
{950DACB0-B011-41AF-B0FB-245F749B01AB} = {2300ED4C-1D5A-460F-8691-7C85E1162E0C}
{B63C506E-5CB5-4DE8-8275-F7BA8354799E} = {54351E51-19CB-4DE3-8302-99846AB216CF}
{A5DFFB52-D8EA-4E1A-BF4F-8B9665C7DAFE} = {F5E37327-3AA9-4CC2-9FE3-B28271ADB5E3}
@ -767,15 +749,20 @@ Global
{47AA5965-5826-489D-B74B-314A61629121} = {54351E51-19CB-4DE3-8302-99846AB216CF}
{B736B03C-1185-4AE5-87B7-665C6790F50F} = {F5E37327-3AA9-4CC2-9FE3-B28271ADB5E3}
{79540E35-45EA-4568-9AB7-C1CC0BFF73EE} = {F5E37327-3AA9-4CC2-9FE3-B28271ADB5E3}
{9237E577-DD0B-4A49-8155-7BC8635F9DBD} = {69157D2B-2AD3-4EE0-A837-6AD9329EDDC3}
{2C7AE89A-648C-4EBC-8084-0E59BAFF496D} = {69157D2B-2AD3-4EE0-A837-6AD9329EDDC3}
{C1FDA6CF-7EF6-4C3F-81E7-4C13EE399BF1} = {69157D2B-2AD3-4EE0-A837-6AD9329EDDC3}
{F921339B-32F9-4BF3-B364-2DB01FA2F1A1} = {2300ED4C-1D5A-460F-8691-7C85E1162E0C}
{8181EB49-62CE-495B-8078-08DCF8C30541} = {F921339B-32F9-4BF3-B364-2DB01FA2F1A1}
{F3B989E5-E7F5-4A07-AEA1-84B63040A190} = {2300ED4C-1D5A-460F-8691-7C85E1162E0C}
{9DB94B1F-D773-4D17-9CD7-54EE5DD3F84B} = {F3B989E5-E7F5-4A07-AEA1-84B63040A190}
{837F5563-BB1C-4A59-A506-07ED8458DB4E} = {F921339B-32F9-4BF3-B364-2DB01FA2F1A1}
{4B0F95CF-E696-450F-B7F6-35E361C91777} = {69157D2B-2AD3-4EE0-A837-6AD9329EDDC3}
{4B0F95CF-E696-450F-B7F6-35E361C91777} = {578D5330-2F72-44C6-9DB5-C93B3F42C473}
{8C964A2F-A163-421C-B262-BE9C81B555BC} = {F921339B-32F9-4BF3-B364-2DB01FA2F1A1}
{57E3932B-639B-4ED5-BC31-9422EB8D842E} = {F921339B-32F9-4BF3-B364-2DB01FA2F1A1}
{C0DFD8A9-EE39-48CA-A458-1403382671C9} = {F921339B-32F9-4BF3-B364-2DB01FA2F1A1}
{6458DBFC-38D5-4784-B92A-A1174D2469B4} = {F921339B-32F9-4BF3-B364-2DB01FA2F1A1}
{3E914549-08C2-4A19-B699-8B707A10A9B0} = {F921339B-32F9-4BF3-B364-2DB01FA2F1A1}
{5918F481-0BE6-4D3F-95EB-34D30C9412DC} = {F921339B-32F9-4BF3-B364-2DB01FA2F1A1}
{E6510C48-92B8-4995-A5C5-CBCB98029863} = {F921339B-32F9-4BF3-B364-2DB01FA2F1A1}
{6208102C-151C-45CE-B573-B9C15B551B4D} = {F921339B-32F9-4BF3-B364-2DB01FA2F1A1}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D71830F5-3AF5-46B4-8A9E-1DCE4F2253AC}

Просмотреть файл

@ -45,7 +45,6 @@
<ItemGroup>
<ProjectReference Include="..\..\edge-util\src\Microsoft.Azure.Devices.Edge.Util\Microsoft.Azure.Devices.Edge.Util.csproj" />
<ProjectReference Include="..\..\edge-agent\src\Microsoft.Azure.Devices.Edge.Agent.Diagnostics\Microsoft.Azure.Devices.Edge.Agent.Diagnostics.csproj" />
<ProjectReference Include="..\ModuleLib\Microsoft.Azure.Devices.Edge.ModuleUtil.csproj" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -7,14 +7,17 @@ namespace MetricsCollector
using System.Threading.Tasks;
using Microsoft.Azure.Devices.Edge.Agent.Diagnostics;
using Microsoft.Azure.Devices.Edge.Agent.Diagnostics.Publisher;
using Microsoft.Azure.Devices.Edge.ModuleUtil;
using Microsoft.Azure.Devices.Edge.Util;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using Serilog;
using Serilog.Core;
using Serilog.Events;
using ILogger = Microsoft.Extensions.Logging.ILogger;
class MetricsScrapeAndUpload : IDisposable
{
static readonly ILogger Logger = ModuleUtil.CreateLogger("MetricsCollector");
static readonly ILogger Logger = MetricsUtil.CreateLogger("MetricsCollector");
readonly IMetricsScraper scraper;
readonly IMetricsPublisher publisher;
PeriodicTask periodicScrapeAndUpload;

Просмотреть файл

@ -0,0 +1,26 @@
// Copyright (c) Microsoft. All rights reserved.
namespace MetricsCollector
{
using Microsoft.Azure.Devices.Edge.Util;
using Microsoft.Extensions.Logging;
using Serilog;
using Serilog.Core;
using Serilog.Events;
using ILogger = Microsoft.Extensions.Logging.ILogger;
public static class MetricsUtil
{
internal static ILogger CreateLogger(string categoryName, LogEventLevel logEventLevel = LogEventLevel.Debug)
{
Preconditions.CheckNonWhiteSpace(categoryName, nameof(categoryName));
var levelSwitch = new LoggingLevelSwitch(logEventLevel);
Log.Logger = new LoggerConfiguration()
.MinimumLevel.ControlledBy(levelSwitch)
.WriteTo.Console(outputTemplate: "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff} {Level:u3}] {Message:lj}{NewLine}{Exception}")
.CreateLogger();
return new LoggerFactory().AddSerilog().CreateLogger(categoryName);
}
}
}

Просмотреть файл

@ -8,13 +8,12 @@ namespace MetricsCollector
using Microsoft.Azure.Devices.Client.Transport.Mqtt;
using Microsoft.Azure.Devices.Edge.Agent.Diagnostics;
using Microsoft.Azure.Devices.Edge.Agent.Diagnostics.Publisher;
using Microsoft.Azure.Devices.Edge.ModuleUtil;
using Microsoft.Azure.Devices.Edge.Util;
using Microsoft.Extensions.Logging;
internal class Program
{
static readonly ILogger Logger = ModuleUtil.CreateLogger("MetricsCollector");
static readonly ILogger Logger = MetricsUtil.CreateLogger("MetricsCollector");
public static int Main() => MainAsync().Result;

Просмотреть файл

@ -45,7 +45,6 @@
<ItemGroup>
<ProjectReference Include="..\..\edge-util\src\Microsoft.Azure.Devices.Edge.Util\Microsoft.Azure.Devices.Edge.Util.csproj" />
<ProjectReference Include="..\ModuleLib\Microsoft.Azure.Devices.Edge.ModuleUtil.csproj" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -8,12 +8,14 @@ namespace SimulatedTemperatureSensor
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure.Devices.Client;
using Microsoft.Azure.Devices.Edge.ModuleUtil;
using Microsoft.Azure.Devices.Client.Transport.Mqtt;
using Microsoft.Azure.Devices.Edge.Util;
using Microsoft.Azure.Devices.Edge.Util.Concurrency;
using Microsoft.Azure.Devices.Edge.Util.TransientFaultHandling;
using Microsoft.Azure.Devices.Shared;
using Microsoft.Extensions.Configuration;
using Newtonsoft.Json;
using ExponentialBackoff = Microsoft.Azure.Devices.Edge.Util.TransientFaultHandling.ExponentialBackoff;
class Program
{
@ -21,6 +23,16 @@ namespace SimulatedTemperatureSensor
const string SendDataConfigKey = "SendData";
const string SendIntervalConfigKey = "SendInterval";
static readonly ITransientErrorDetectionStrategy DefaultTimeoutErrorDetectionStrategy =
new DelegateErrorDetectionStrategy(ex => ex.HasTimeoutException());
static readonly RetryStrategy DefaultTransientRetryStrategy =
new ExponentialBackoff(
5,
TimeSpan.FromSeconds(2),
TimeSpan.FromSeconds(60),
TimeSpan.FromSeconds(4));
static readonly Guid BatchId = Guid.NewGuid();
static readonly AtomicBoolean Reset = new AtomicBoolean(false);
static readonly Random Rnd = new Random();
@ -64,10 +76,10 @@ namespace SimulatedTemperatureSensor
TransportType transportType = configuration.GetValue("ClientTransportType", TransportType.Amqp_Tcp_Only);
ModuleClient moduleClient = await ModuleUtil.CreateModuleClientAsync(
ModuleClient moduleClient = await CreateModuleClientAsync(
transportType,
ModuleUtil.DefaultTimeoutErrorDetectionStrategy,
ModuleUtil.DefaultTransientRetryStrategy);
DefaultTimeoutErrorDetectionStrategy,
DefaultTransientRetryStrategy);
await moduleClient.OpenAsync();
await moduleClient.SetMethodHandlerAsync("reset", ResetMethod, null);
@ -249,6 +261,45 @@ namespace SimulatedTemperatureSensor
await moduleClient.UpdateReportedPropertiesAsync(patch); // Just report back last desired property.
}
static async Task<ModuleClient> CreateModuleClientAsync(
TransportType transportType,
ITransientErrorDetectionStrategy transientErrorDetectionStrategy = null,
RetryStrategy retryStrategy = null)
{
var retryPolicy = new RetryPolicy(transientErrorDetectionStrategy, retryStrategy);
retryPolicy.Retrying += (_, args) => { Console.WriteLine($"[Error] Retry {args.CurrentRetryCount} times to create module client and failed with exception:{Environment.NewLine}{args.LastException}"); };
ModuleClient client = await retryPolicy.ExecuteAsync(
async () =>
{
ITransportSettings[] GetTransportSettings()
{
switch (transportType)
{
case TransportType.Mqtt:
case TransportType.Mqtt_Tcp_Only:
return new ITransportSettings[] { new MqttTransportSettings(TransportType.Mqtt_Tcp_Only) };
case TransportType.Mqtt_WebSocket_Only:
return new ITransportSettings[] { new MqttTransportSettings(TransportType.Mqtt_WebSocket_Only) };
case TransportType.Amqp_WebSocket_Only:
return new ITransportSettings[] { new AmqpTransportSettings(TransportType.Amqp_WebSocket_Only) };
default:
return new ITransportSettings[] { new AmqpTransportSettings(TransportType.Amqp_Tcp_Only) };
}
}
ITransportSettings[] settings = GetTransportSettings();
Console.WriteLine($"[Information]: Trying to initialize module client using transport type [{transportType}].");
ModuleClient moduleClient = await ModuleClient.CreateFromEnvironmentAsync(settings);
await moduleClient.OpenAsync();
Console.WriteLine($"[Information]: Successfully initialized module client of transport type [{transportType}].");
return moduleClient;
});
return client;
}
class ControlCommand
{
[JsonProperty("command")]

Просмотреть файл

@ -47,7 +47,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\edge-modules\ModuleLib\Microsoft.Azure.Devices.Edge.ModuleUtil.csproj" />
<ProjectReference Include="..\..\..\modules\ModuleLib\Microsoft.Azure.Devices.Edge.ModuleUtil.csproj" />
<ProjectReference Include="..\..\..\..\edge-util\src\Microsoft.Azure.Devices.Edge.Util\Microsoft.Azure.Devices.Edge.Util.csproj" />
</ItemGroup>
<PropertyGroup>

Просмотреть файл

@ -43,7 +43,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\edge-util\src\Microsoft.Azure.Devices.Edge.Util\Microsoft.Azure.Devices.Edge.Util.csproj" />
<ProjectReference Include="..\..\..\edge-util\src\Microsoft.Azure.Devices.Edge.Util\Microsoft.Azure.Devices.Edge.Util.csproj" />
<ProjectReference Include="..\ModuleLib\Microsoft.Azure.Devices.Edge.ModuleUtil.csproj" />
</ItemGroup>
@ -54,10 +54,10 @@
</ItemGroup>
<ItemGroup>
<AdditionalFiles Include="..\..\stylecop.json" Link="stylecop.json" />
<AdditionalFiles Include="..\..\..\stylecop.json" Link="stylecop.json" />
</ItemGroup>
<PropertyGroup>
<CodeAnalysisRuleSet>..\..\stylecop.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet>..\..\..\stylecop.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<Import Project="..\..\stylecop.props" />
<Import Project="..\..\..\stylecop.props" />
</Project>

Просмотреть файл

@ -45,7 +45,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\edge-util\src\Microsoft.Azure.Devices.Edge.Util\Microsoft.Azure.Devices.Edge.Util.csproj" />
<ProjectReference Include="..\..\..\edge-util\src\Microsoft.Azure.Devices.Edge.Util\Microsoft.Azure.Devices.Edge.Util.csproj" />
<ProjectReference Include="..\ModuleLib\Microsoft.Azure.Devices.Edge.ModuleUtil.csproj" />
</ItemGroup>
@ -56,10 +56,10 @@
</ItemGroup>
<ItemGroup>
<AdditionalFiles Include="..\..\stylecop.json" Link="stylecop.json" />
<AdditionalFiles Include="..\..\..\stylecop.json" Link="stylecop.json" />
</ItemGroup>
<PropertyGroup>
<CodeAnalysisRuleSet>..\..\stylecop.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet>..\..\..\stylecop.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<Import Project="..\..\stylecop.props" />
<Import Project="..\..\..\stylecop.props" />
</Project>

Просмотреть файл

@ -14,16 +14,16 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\edge-util\src\Microsoft.Azure.Devices.Edge.Util\Microsoft.Azure.Devices.Edge.Util.csproj" />
<ProjectReference Include="..\..\..\edge-util\src\Microsoft.Azure.Devices.Edge.Util\Microsoft.Azure.Devices.Edge.Util.csproj" />
</ItemGroup>
<ItemGroup>
<AdditionalFiles Include="..\..\stylecop.json" Link="stylecop.json" />
<AdditionalFiles Include="..\..\..\stylecop.json" Link="stylecop.json" />
</ItemGroup>
<PropertyGroup>
<CodeAnalysisRuleSet>..\..\stylecop.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet>..\..\..\stylecop.ruleset</CodeAnalysisRuleSet>
<RootNamespace>Microsoft.Azure.Devices.Edge.ModuleUtil</RootNamespace>
<AssemblyName>Microsoft.Azure.Devices.Edge.ModuleUtil</AssemblyName>
</PropertyGroup>
<Import Project="..\..\stylecop.props" />
<Import Project="..\..\..\stylecop.props" />
</Project>

Просмотреть файл

@ -1,66 +1,66 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Condition="'$(DotNet_Runtime)' != 'netcoreapp3.0'">
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(OS)|$(DotNet_Runtime)' == 'Unix|netcoreapp3.0'">
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<Configurations>Debug;Release;CodeCoverage;CheckInBuild</Configurations>
<HighEntropyVA>true</HighEntropyVA>
</PropertyGroup>
<!--
Normally, the 'Debug' configuration would work for code coverage, but Microsoft.CodeCoverage currently requires '<DebugType>full</DebugType>' for .NET Core.
See https://github.com/Microsoft/vstest-docs/blob/06f9dc0aeb47be7204dc4e1a98c110ead3e978c7/docs/analyze.md#setup-a-project.
That setting seems to break the "Open Test" context menu in VS IDE, so we'll use a dedicated configuration for code coverage.
-->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'CodeCoverage|AnyCPU' ">
<IntermediateOutputPath>obj\CodeCoverage</IntermediateOutputPath>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\CodeCoverage</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Content Include="docker*/**/*.*" CopyToPublishDirectory="Always" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Devices" Version="1.18.2" />
<PackageReference Include="Microsoft.Azure.Devices.Client" Version="1.21.3" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.0.0" />
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\edge-util\src\Microsoft.Azure.Devices.Edge.Util\Microsoft.Azure.Devices.Edge.Util.csproj" />
<ProjectReference Include="..\ModuleLib\Microsoft.Azure.Devices.Edge.ModuleUtil.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="config/appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<AdditionalFiles Include="..\..\stylecop.json" Link="stylecop.json" />
</ItemGroup>
<PropertyGroup>
<CodeAnalysisRuleSet>..\..\stylecop.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<Import Project="..\..\stylecop.props" />
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Condition="'$(DotNet_Runtime)' != 'netcoreapp3.0'">
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(OS)|$(DotNet_Runtime)' == 'Unix|netcoreapp3.0'">
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<Configurations>Debug;Release;CodeCoverage;CheckInBuild</Configurations>
<HighEntropyVA>true</HighEntropyVA>
</PropertyGroup>
<!--
Normally, the 'Debug' configuration would work for code coverage, but Microsoft.CodeCoverage currently requires '<DebugType>full</DebugType>' for .NET Core.
See https://github.com/Microsoft/vstest-docs/blob/06f9dc0aeb47be7204dc4e1a98c110ead3e978c7/docs/analyze.md#setup-a-project.
That setting seems to break the "Open Test" context menu in VS IDE, so we'll use a dedicated configuration for code coverage.
-->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'CodeCoverage|AnyCPU' ">
<IntermediateOutputPath>obj\CodeCoverage</IntermediateOutputPath>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\CodeCoverage</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Content Include="docker*/**/*.*" CopyToPublishDirectory="Always" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Devices" Version="1.18.2" />
<PackageReference Include="Microsoft.Azure.Devices.Client" Version="1.21.3" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.0.0" />
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\edge-util\src\Microsoft.Azure.Devices.Edge.Util\Microsoft.Azure.Devices.Edge.Util.csproj" />
<ProjectReference Include="..\ModuleLib\Microsoft.Azure.Devices.Edge.ModuleUtil.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="config/appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<AdditionalFiles Include="..\..\..\stylecop.json" Link="stylecop.json" />
</ItemGroup>
<PropertyGroup>
<CodeAnalysisRuleSet>..\..\..\stylecop.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<Import Project="..\..\..\stylecop.props" />
</Project>

Просмотреть файл

@ -1,85 +1,85 @@
// Copyright (c) Microsoft. All rights reserved.
namespace ModuleRestarter
{
using System;
using System.Collections.Generic;
using System.Net;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure.Devices;
using Microsoft.Azure.Devices.Edge.ModuleUtil;
using Microsoft.Azure.Devices.Edge.Util;
using Microsoft.Extensions.Logging;
class Program
{
static readonly ILogger Logger = ModuleUtil.CreateLogger("ModuleRestarter");
public static int Main() => MainAsync().Result;
static async Task<int> MainAsync()
{
Logger.LogInformation($"Starting module restarter with the following settings:\r\n{Settings.Current}");
if (Settings.Current.DesiredModulesToRestart.Count == 0)
{
Logger.LogInformation("No modules names found in input. Stopping.");
return 0;
}
(CancellationTokenSource cts, ManualResetEventSlim completed, Option<object> handler) = ShutdownHandler.Init(TimeSpan.FromSeconds(5), Logger);
await RestartModules(cts);
completed.Set();
handler.ForEach(h => GC.KeepAlive(h));
Logger.LogInformation("ModuleRestarter Main() finished.");
return 0;
}
/// <summary>
/// Restarts random modules periodically (with default restart occurrence once every 10 minutes)
/// </summary>
static async Task RestartModules(CancellationTokenSource cts)
{
try
{
ServiceClient iotHubServiceClient = ServiceClient.CreateFromConnectionString(Settings.Current.ServiceClientConnectionString);
CloudToDeviceMethod c2dMethod = new CloudToDeviceMethod("RestartModule");
Random random = new Random();
string payloadSchema = "{{ \"SchemaVersion\": \"1.0\", \"Id\": \"{0}\" }}";
List<string> moduleNames = Settings.Current.DesiredModulesToRestart;
while (!cts.Token.IsCancellationRequested)
{
string payload = string.Format(payloadSchema, moduleNames[random.Next(0, moduleNames.Count)]);
Logger.LogInformation("RestartModule Method Payload: {0}", payload);
c2dMethod.SetPayloadJson(payload);
try
{
CloudToDeviceMethodResult response = await iotHubServiceClient.InvokeDeviceMethodAsync(Settings.Current.DeviceId, "$edgeAgent", c2dMethod);
if (response.Status != (int)HttpStatusCode.OK)
{
Logger.LogError($"Calling Direct Method failed with status code {response.Status}.");
}
}
catch (Exception e)
{
Logger.LogError($"Exception caught for payload {payload}: {e}");
}
await Task.Delay(Settings.Current.RestartIntervalInMins * 60 * 1000, cts.Token);
}
}
catch (Exception e)
{
Logger.LogError($"Exception caught: {e}");
throw;
}
Logger.LogInformation("RestartModules finished.");
}
}
}
// Copyright (c) Microsoft. All rights reserved.
namespace ModuleRestarter
{
using System;
using System.Collections.Generic;
using System.Net;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure.Devices;
using Microsoft.Azure.Devices.Edge.ModuleUtil;
using Microsoft.Azure.Devices.Edge.Util;
using Microsoft.Extensions.Logging;
class Program
{
static readonly ILogger Logger = ModuleUtil.CreateLogger("ModuleRestarter");
public static int Main() => MainAsync().Result;
static async Task<int> MainAsync()
{
Logger.LogInformation($"Starting module restarter with the following settings:\r\n{Settings.Current}");
if (Settings.Current.DesiredModulesToRestart.Count == 0)
{
Logger.LogInformation("No modules names found in input. Stopping.");
return 0;
}
(CancellationTokenSource cts, ManualResetEventSlim completed, Option<object> handler) = ShutdownHandler.Init(TimeSpan.FromSeconds(5), Logger);
await RestartModules(cts);
completed.Set();
handler.ForEach(h => GC.KeepAlive(h));
Logger.LogInformation("ModuleRestarter Main() finished.");
return 0;
}
/// <summary>
/// Restarts random modules periodically (with default restart occurrence once every 10 minutes)
/// </summary>
static async Task RestartModules(CancellationTokenSource cts)
{
try
{
ServiceClient iotHubServiceClient = ServiceClient.CreateFromConnectionString(Settings.Current.ServiceClientConnectionString);
CloudToDeviceMethod c2dMethod = new CloudToDeviceMethod("RestartModule");
Random random = new Random();
string payloadSchema = "{{ \"SchemaVersion\": \"1.0\", \"Id\": \"{0}\" }}";
List<string> moduleNames = Settings.Current.DesiredModulesToRestart;
while (!cts.Token.IsCancellationRequested)
{
string payload = string.Format(payloadSchema, moduleNames[random.Next(0, moduleNames.Count)]);
Logger.LogInformation("RestartModule Method Payload: {0}", payload);
c2dMethod.SetPayloadJson(payload);
try
{
CloudToDeviceMethodResult response = await iotHubServiceClient.InvokeDeviceMethodAsync(Settings.Current.DeviceId, "$edgeAgent", c2dMethod);
if (response.Status != (int)HttpStatusCode.OK)
{
Logger.LogError($"Calling Direct Method failed with status code {response.Status}.");
}
}
catch (Exception e)
{
Logger.LogError($"Exception caught for payload {payload}: {e}");
}
await Task.Delay(Settings.Current.RestartIntervalInMins * 60 * 1000, cts.Token);
}
}
catch (Exception e)
{
Logger.LogError($"Exception caught: {e}");
throw;
}
Logger.LogInformation("RestartModules finished.");
}
}
}

Просмотреть файл

Просмотреть файл

@ -31,21 +31,21 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\edge-util\src\Microsoft.Azure.Devices.Edge.Util\Microsoft.Azure.Devices.Edge.Util.csproj" />
<ProjectReference Include="..\..\..\edge-util\src\Microsoft.Azure.Devices.Edge.Util\Microsoft.Azure.Devices.Edge.Util.csproj" />
<ProjectReference Include="..\ModuleLib\Microsoft.Azure.Devices.Edge.ModuleUtil.csproj" />
</ItemGroup>
<ItemGroup>
<AdditionalFiles Include="..\..\stylecop.json" Link="stylecop.json" />
</ItemGroup>
<ItemGroup>
<None Update="config/settings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<AdditionalFiles Include="..\..\..\stylecop.json" Link="stylecop.json" />
</ItemGroup>
<PropertyGroup>
<CodeAnalysisRuleSet>..\..\stylecop.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet>..\..\..\stylecop.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<Import Project="..\..\stylecop.props" />
<Import Project="..\..\..\stylecop.props" />
</Project>

Просмотреть файл

Просмотреть файл

@ -42,15 +42,15 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\edge-util\src\Microsoft.Azure.Devices.Edge.Util\Microsoft.Azure.Devices.Edge.Util.csproj" />
<ProjectReference Include="..\..\..\edge-util\src\Microsoft.Azure.Devices.Edge.Util\Microsoft.Azure.Devices.Edge.Util.csproj" />
<ProjectReference Include="..\ModuleLib\Microsoft.Azure.Devices.Edge.ModuleUtil.csproj" />
</ItemGroup>
<ItemGroup>
<AdditionalFiles Include="..\..\stylecop.json" Link="stylecop.json" />
<AdditionalFiles Include="..\..\..\stylecop.json" Link="stylecop.json" />
</ItemGroup>
<PropertyGroup>
<CodeAnalysisRuleSet>..\..\stylecop.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet>..\..\..\stylecop.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<Import Project="..\..\stylecop.props" />
<Import Project="..\..\..\stylecop.props" />
</Project>

Просмотреть файл

@ -36,9 +36,9 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\edge-util\src\Microsoft.Azure.Devices.Edge.Storage.RocksDb\Microsoft.Azure.Devices.Edge.Storage.RocksDb.csproj" />
<ProjectReference Include="..\..\edge-util\src\Microsoft.Azure.Devices.Edge.Storage\Microsoft.Azure.Devices.Edge.Storage.csproj" />
<ProjectReference Include="..\..\edge-util\src\Microsoft.Azure.Devices.Edge.Util\Microsoft.Azure.Devices.Edge.Util.csproj" />
<ProjectReference Include="..\..\..\edge-util\src\Microsoft.Azure.Devices.Edge.Storage.RocksDb\Microsoft.Azure.Devices.Edge.Storage.RocksDb.csproj" />
<ProjectReference Include="..\..\..\edge-util\src\Microsoft.Azure.Devices.Edge.Storage\Microsoft.Azure.Devices.Edge.Storage.csproj" />
<ProjectReference Include="..\..\..\edge-util\src\Microsoft.Azure.Devices.Edge.Util\Microsoft.Azure.Devices.Edge.Util.csproj" />
<ProjectReference Include="..\ModuleLib\Microsoft.Azure.Devices.Edge.ModuleUtil.csproj" />
</ItemGroup>
@ -49,10 +49,10 @@
</ItemGroup>
<ItemGroup>
<AdditionalFiles Include="..\..\stylecop.json" Link="stylecop.json" />
<AdditionalFiles Include="..\..\..\stylecop.json" Link="stylecop.json" />
</ItemGroup>
<PropertyGroup>
<CodeAnalysisRuleSet>..\..\stylecop.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet>..\..\..\stylecop.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<Import Project="..\..\stylecop.props" />
<Import Project="..\..\..\stylecop.props" />
</Project>

Просмотреть файл

@ -35,7 +35,7 @@
<ProjectReference Include="..\..\..\edge-util\src\Microsoft.Azure.Devices.Edge.Storage.RocksDb\Microsoft.Azure.Devices.Edge.Storage.RocksDb.csproj" />
<ProjectReference Include="..\..\..\edge-util\src\Microsoft.Azure.Devices.Edge.Storage\Microsoft.Azure.Devices.Edge.Storage.csproj" />
<ProjectReference Include="..\..\..\edge-util\src\Microsoft.Azure.Devices.Edge.Util\Microsoft.Azure.Devices.Edge.Util.csproj" />
<ProjectReference Include="..\..\..\edge-modules\ModuleLib\Microsoft.Azure.Devices.Edge.ModuleUtil.csproj" />
<ProjectReference Include="..\ModuleLib\Microsoft.Azure.Devices.Edge.ModuleUtil.csproj" />
</ItemGroup>
<ItemGroup>

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше