{"id":297561,"date":"2020-01-23T15:00:27","date_gmt":"2020-01-23T15:00:27","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=297561"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=297561","title":{"rendered":"\u0415\u0449\u0435 \u043e\u0434\u0438\u043d \u0441\u043f\u043e\u0441\u043e\u0431 \u0438\u0437\u043c\u0435\u0440\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u043e\u0432 .NET \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439"},"content":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/485198\/\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/-q\/hs\/z8\/-qhsz8oawswkr7chwsijjbkrr1y.png\"\/><\/p>\n<p>  <\/p>\n<p>\u0417\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u043f\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 (\u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0443\u0436\u0435 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043e), \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u044f\u0432\u043b\u044f\u0442\u044c \u0435\u0433\u043e \u0443\u0437\u043a\u0438\u0435 \u043c\u0435\u0441\u0442\u0430, \u0438 \u0432\u0438\u0434\u0435\u0442\u044c, \u043a\u0430\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0442\u043e\u0440\u043c\u043e\u0437\u0438\u0442.<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u043f\u043e\u043c\u0438\u043c\u043e \u0441\u0430\u043c\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 (\u0432\u0440\u0435\u043c\u044f \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043c\u0435\u0442\u043e\u0434\u0430, \u0434\u0430\u0442\u0430 \u043d\u0430\u0447\u0430\u043b\u0430 \u0438 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u0435\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430) \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0432\u044b\u0437\u043e\u0432\u0430, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c (\u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u043c \u0434\u0430\u043d\u043d\u044b\u0435).<\/p>\n<p>  <\/p>\n<p>\u041d\u0443 \u0438 &quot;\u0432\u0438\u0448\u0435\u043d\u043a\u043e\u0439 \u043d\u0430 \u0442\u043e\u0440\u0442\u0435&quot; \u043c\u043e\u0436\u043d\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430, \u0447\u0442\u043e \u0442\u043e\u0436\u0435 \u043d\u0435\u043c\u0430\u043b\u043e\u0432\u0430\u0436\u043d\u043e.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u0438 \u0431\u044b\u043b\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u0430 \u043a\u0440\u043e\u0441\u0441-\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u0430\u044f open-source .NET \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <a href=\"https:\/\/github.com\/unchase\/Unchase.FluentPerformanceMeter\">Unchase.FluentPerformanceMeter<\/a>.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2 id=\"vvedenie\">\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u0418\u0442\u0430\u043a, \u0434\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 <a href=\"https:\/\/github.com\/unchase\/Unchase.FluentPerformanceMeter\"><strong>Unchase Fluent Performance Meter<\/strong><\/a> \u2014 \u043a\u0440\u043e\u0441\u0441-\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0439 open-source <em>.Net Standard 2.0<\/em> \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u043e\u0439 \u0434\u043b\u044f \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432.<\/p>\n<p>  <\/p>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u0432 .NET Core \u0438 .NET Framework \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u0445 <em>.Net Standard 2.0<\/em>, \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442:<\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"#a-namesimplesamplesa-primery-ispolzovaniya\"><strong>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0442\u043e\u0447\u043d\u044b\u0435 \u0437\u0430\u043c\u0435\u0440\u044b<\/strong><\/a> \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 <strong><em>public<\/em> \u043c\u0435\u0442\u043e\u0434\u043e\u0432<\/strong> \u0434\u043b\u044f <strong><em>public<\/em> \u043a\u043b\u0430\u0441\u0441\u043e\u0432<\/strong> \u043a\u0430\u043a \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0434\u0430, \u0442\u0430\u043a \u0438 <a href=\"#a-namesampleexternala-izmerenie-proizvoditelnosti-metoda-ispolzuemoy-biblioteki\">\u043a\u043e\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a<\/a> (\u0441 \u0444\u0438\u043a\u0441\u0430\u0446\u0438\u0435\u0439 \u0442\u043e\u0447\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430\u0447\u0430\u043b\u0430 \u0438 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043c\u0435\u0440\u0430);<\/li>\n<li><a href=\"#a-namesamplecustomdataa-dobavlenie-dopolnitelnyh-dannyh-custom-data-i-razbienie-na-shagi-steps\"><strong>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c<\/strong><\/a> \u0437\u0430\u043c\u0435\u0440\u043e\u0432 <strong>\u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/strong> (Custom Data). \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430 \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442; \u0438\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430; \u0438\u043b\u0438 <em>corellationId<\/em>, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u0432\u044f\u0437\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432;<\/li>\n<li><a href=\"#a-namesamplecustomdataa-dobavlenie-dopolnitelnyh-dannyh-custom-data-i-razbienie-na-shagi-steps\"><strong>\u0420\u0430\u0437\u0431\u0438\u0432\u0430\u0442\u044c \u0437\u0430\u043c\u0435\u0440<\/strong><\/a> \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 <strong>\u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0448\u0430\u0433\u0438<\/strong> (Steps) \u0441 \u0444\u0438\u043a\u0441\u0430\u0446\u0438\u0435\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0448\u0430\u0433\u0430. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e <a href=\"#a-namesampleignorea-isklyuchenie-iz-zamera-ignore\">\u0437\u0430\u0434\u0430\u0442\u044c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f<\/a> \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0448\u0430\u0433 \u0431\u0443\u0434\u0435\u0442 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0437\u0430\u043c\u0435\u0440\u0435 (\u0435\u0441\u043b\u0438 \u0448\u0430\u0433 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0442\u043e \u043d\u0435 \u043f\u043e\u043f\u0430\u0434\u0451\u0442 \u0432 \u0437\u0430\u043c\u0435\u0440);<\/li>\n<li><a href=\"#a-namesampleignorea-isklyuchenie-iz-zamera-ignore\"><strong>\u0418\u0441\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0438\u0437 \u0437\u0430\u043c\u0435\u0440\u0430<\/strong><\/a> \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 <strong>\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u0438 \u043a\u043e\u0434\u0430<\/strong> (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b\u0437\u043e\u0432\u044b \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u0432\u0440\u0435\u043c\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u0437\u0430\u043c\u0435\u0440\u0435);<\/li>\n<li><a href=\"#a-namesamplecustomcommandsa-dobavlenie-komand-commands-i-deystviy-actions\"><strong>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b<\/strong><\/a> (Commands), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e <strong>\u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435<\/strong> \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u0437\u0430\u043c\u0435\u0440\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u043b\u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435);<\/li>\n<li><a href=\"#a-namesamplecustomexceptionhandlera-dobavlenie-obrabotchikov-isklyucheniy-exception-handlers\"><strong>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0432\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439<\/strong><\/a> \u0434\u043b\u044f \u043a\u043e\u0434\u0430, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0437\u0430\u043c\u0435\u0440\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 (\u043a\u0430\u043a \u043e\u0431\u0449\u0438\u0439 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0437\u0430\u043c\u0435\u0440\u043e\u0432, \u0442\u0430\u043a \u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0437\u0430\u043c\u0435\u0440\u0430 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438);<\/li>\n<li><a href=\"#a-namesamplesettingcachetimea-ustanovka-vremeni-hraneniya-dannyh-set-cache-time\"><strong>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432<\/strong><\/a> \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u043f\u043e \u0438\u0441\u0442\u0435\u0447\u0435\u043d\u0438\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u0443\u0434\u0430\u043b\u0435\u043d\u044b;<\/li>\n<li><a href=\"#a-namesamplesetcallerandsourcewithstopa-dobavlenie-dannyh-o-vyzyvayuschem-metod-i-meste-vyzova-i-preryvanie-zamera-proizvoditelnosti\"><strong>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0437\u0430\u043c\u0435\u0440\u0430<\/strong><\/a> \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0442\u043e\u043c, <strong>\u043a\u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043c\u0435\u0442\u043e\u0434<\/strong> (Caller) \u0447\u0435\u0440\u0435\u0437 <em>IHttpContextAccesor<\/em> \u0438\u043b\u0438 \u0437\u0430\u0434\u0430\u043d\u0438\u0435 Caller&#8217;\u0430 \u0432 \u043a\u043e\u0434\u0435 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0437\u0432\u0430\u043b \u043c\u0435\u0442\u043e\u0434);<\/li>\n<li><a href=\"#a-namesamplesetcallerandsourcewithstopa-dobavlenie-dannyh-o-vyzyvayuschem-metod-i-meste-vyzova-i-preryvanie-zamera-proizvoditelnosti\"><strong>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0437\u0430\u043c\u0435\u0440\u0430<\/strong><\/a> \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043c\u0435\u0441\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0437\u0430\u043c\u0435\u0440\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 (\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \u0438 \u043d\u043e\u043c\u0435\u0440 \u0441\u0442\u0440\u043e\u043a\u0438 \u0441 \u043c\u0435\u0441\u0442\u043e\u043c \u0432\u044b\u0437\u043e\u0432\u0430 \u0432 \u043a\u043e\u0434\u0435);<\/li>\n<li><a href=\"#a-namesamplesetcallerandsourcewithstopa-dobavlenie-dannyh-o-vyzyvayuschem-metod-i-meste-vyzova-i-preryvanie-zamera-proizvoditelnosti\"><strong>\u041f\u0440\u0435\u0440\u0432\u0430\u0442\u044c \u0437\u0430\u043c\u0435\u0440<\/strong><\/a> \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 <strong>\u0434\u043e \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u0435\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f<\/strong>.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0435\u0433\u043e \u0447\u0430\u0441\u0442\u0435\u0439, \u043a\u0430\u043a \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u2014 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434, \u0442\u0430\u043a \u0438 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u2014 \u043a\u043e\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a) \u0438 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0432 \u0443\u0434\u043e\u0431\u043d\u043e\u043c \u0434\u043b\u044f \u0432\u0430\u0441 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0432\u0438\u0434\u0435.<\/p>\n<p>  <\/p>\n<h2 id=\"soderzhanie\">\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<ul>\n<li><a href=\"#a-namestarta-nachalo-raboty\">\u041d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b<\/a><\/li>\n<li><a href=\"#a-namesimplesamplesa-primery-ispolzovaniya\">\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f<\/a><br \/> \n<ul>\n<li><a href=\"#SimpleSamples\">\u0418\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u0430<\/a><\/li>\n<li><a href=\"#a-namediagnosticsourcesamplea-izmerenie-proizvoditelnosti-metoda-s-pomoschyu-diagnosticsource\">\u0418\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e DiagnosticSource<\/a><\/li>\n<li><a href=\"#a-namesampleexternala-izmerenie-proizvoditelnosti-metoda-ispolzuemoy-biblioteki\">\u0418\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/a><\/li>\n<li><a href=\"#a-namesamplecustomdataa-dobavlenie-dopolnitelnyh-dannyh-custom-data-i-razbienie-na-shagi-steps\">\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 (Custom Data) \u0438 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0435 \u043d\u0430 \u0448\u0430\u0433\u0438 (Steps)<\/a><\/li>\n<li><a href=\"#a-namesampleignorea-isklyuchenie-iz-zamera-ignore\">\u0418\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u0437\u0430\u043c\u0435\u0440\u0430 (Ignore)<\/a><\/li>\n<li><a href=\"#a-namesamplecustomcommandsa-dobavlenie-komand-commands-i-deystviy-actions\">\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434 (Commands) \u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 (Actions)<\/a><\/li>\n<li><a href=\"#a-namesamplecustomexceptionhandlera-dobavlenie-obrabotchikov-isklyucheniy-exception-handlers\">\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 (Exception Handlers)<\/a><\/li>\n<li><a href=\"#a-namesamplesettingcachetimea-ustanovka-vremeni-hraneniya-dannyh-set-cache-time\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 (Set Cache Time)<\/a><\/li>\n<li><a href=\"#a-namesamplesetcallerandsourcewithstopa-dobavlenie-dannyh-o-vyzyvayuschem-metod-i-meste-vyzova-i-preryvanie-zamera-proizvoditelnosti\">\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0435\u043c \u043c\u0435\u0442\u043e\u0434 \u0438 \u043c\u0435\u0441\u0442\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 (\u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435 \u0437\u0430\u043c\u0435\u0440\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438)<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>  <\/p>\n<h2 id=\"a-namestarta-nachalo-raboty\"> \u041d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b<\/h2>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 <a href=\"https:\/\/www.nuget.org\/packages\/Unchase.FluentPerformanceMeter\/\"><em>NuGet<\/em> \u043f\u0430\u043a\u0435\u0442<\/a> \u0432 \u0432\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442:<\/p>\n<p>  <\/p>\n<h4 id=\"vruchnuyu-s-pomoschyu-menedzhera-nuget-paketov-package-manager\">\u0412\u0440\u0443\u0447\u043d\u0443\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 <em>NuGet<\/em> \u043f\u0430\u043a\u0435\u0442\u043e\u0432 (Package Manager):<\/h4>\n<p>  <\/p>\n<pre><code class=\"powershell\">Install-Package Unchase.FluentPerformanceMeter<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"s-pomoschyu-net-cli\">\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e .NET CLI:<\/h4>\n<p>  <\/p>\n<pre><code class=\"powershell\">dotnet add package Unchase.FluentPerformanceMeter --version {version}<\/code><\/pre>\n<p>  <\/p>\n<blockquote><p>\u0413\u0434\u0435 {version} \u2014 \u044d\u0442\u043e \u0432\u0435\u0440\u0441\u0438\u044f \u043f\u0430\u043a\u0435\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c.<br \/>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>dotnet add package Unchase.FluentPerformanceMeter --version 1.0.0<\/code><\/p><\/blockquote>\n<p>  <\/p>\n<h2 id=\"a-namesimplesamplesa-primery-ispolzovaniya\"> \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f<\/h2>\n<p>  <\/p>\n<h3 id=\"izmerenie-proizvoditelnosti-metoda\">\u0418\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u0430<\/h3>\n<p>  <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 (\u0431\u0435\u0437 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a) \u0434\u043b\u044f \u0437\u0430\u043c\u0435\u0440\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 (Action) <code>SimpleWatchingMethodStart<\/code> \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 (Controller) <code>PerformanceMeterController<\/code> <em>Asp.Net Core 2.2 WebAPI<\/em> \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f <code>.WatchingMethod().Start()<\/code> \u0438\u043b\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u043f\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 <code>.StartWatching()<\/code>.<br \/>  \u0421 \u0432\u0435\u0440\u0441\u0438\u0438 v1.0.5 \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>.WatchingMethod().Start(SimpleWatchingMethodStart)<\/code> \u0438\u043b\u0438 <code>.StartWatching(SimpleWatchingMethodStart)<\/code> \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u0438\u043c\u0435\u043d\u0438 \u043c\u0435\u0442\u043e\u0434\u0430. <\/p>\n<p>  <\/p>\n<blockquote><p>\u0412\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 <code>Unchase.FluentPerformanceMeter.Test*<\/code> <a href=\"https:\/\/github.com\/unchase\/Unchase.FluentPerformanceMeter\">\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f<\/a>.<\/p><\/blockquote>\n<p>  <\/p>\n<pre><code class=\"plaintext\">\/\/\/ &lt;summary&gt; \/\/\/ Test GET method with simple performance watching. \/\/\/ &lt;\/summary&gt; [HttpGet(&quot;SimpleWatchingMethodStart&quot;)] public ActionResult SimpleWatchingMethodStart() {        \/\/ for C# 8 you can use:     \/\/using var pm = PerformanceMeter&lt;PerformanceMeterController&gt;.StartWatching();      using (PerformanceMeter&lt;PerformanceMeterController&gt;.WatchingMethod().Start())     {         \/\/ put your code with some logic here          return Ok();     } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043a\u043b\u0430\u0441\u0441\u0430-\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 <code>PerformanceMeterController<\/code> \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043c\u0435\u0442\u043e\u0434:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">\/\/\/ &lt;summary&gt; \/\/\/ Get methods performance info for this controller. \/\/\/ &lt;\/summary&gt; \/\/\/ &lt;returns&gt;Returns methods performance info.&lt;\/returns&gt; [HttpGet(&quot;GetPerformanceInfo&quot;)] [IgnoreMethodPerformance] public ActionResult&lt;IPerformanceInfo&gt; GetPerformanceInfo() {     return Ok(PerformanceMeter&lt;PerformanceMeterController&gt;.PerformanceInfo); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 <code>SimpleWatchingMethodStart<\/code> \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 <code>GetPerformanceInfo<\/code> \u043f\u043e\u043b\u0443\u0447\u0438\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"json\">{   &quot;methodCalls&quot;: [     {       &quot;methodName&quot;: &quot;SimpleWatchingMethodStart&quot;,       &quot;elapsed&quot;: &quot;00:00:00.0016350&quot;,       &quot;caller&quot;: &quot;unknown&quot;,       &quot;startTime&quot;: &quot;2019-12-06T10:27:27.3385385Z&quot;,       &quot;endTime&quot;: &quot;2019-12-06T10:27:27.3401735Z&quot;,       &quot;customData&quot;: {},       &quot;steps&quot;: []     }   ],   &quot;totalActivity&quot;: [     {       &quot;methodName&quot;: &quot;SimpleWatchingMethodStart&quot;,       &quot;callsCount&quot;: 1     }   ],   &quot;currentActivity&quot;: [     {       &quot;methodName&quot;: &quot;SimpleWatchingMethodStart&quot;,       &quot;callsCount&quot;: 0     }   ],   &quot;uptimeSince&quot;: &quot;2019-12-06T10:27:27.3370183Z&quot;,   &quot;className&quot;: &quot;Unchase.FluentPerformanceMeter.TestWebAPI.Controllers.PerformanceMeterController&quot;,   &quot;methodNames&quot;: [     &quot;SimpleWatchingMethodStart&quot;   ],   &quot;customData&quot;: {},   &quot;timerFrequency&quot;: 10000000 }<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"a-namediagnosticsourcesamplea-izmerenie-proizvoditelnosti-metoda-s-pomoschyu-diagnosticsource\"> \u0418\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>DiagnosticSource<\/code><\/h3>\n<p>  <\/p>\n<p>\u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 <em>v1.1.0<\/em> \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043c\u0435\u0440\u044f\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0432 <em>AspNetCore MVC<\/em> \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>DiagnosticSource<\/code> \u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 <code>WatchingWithDiagnosticSourceAttribute<\/code>.<br \/>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 <em>NuGet<\/em> \u043f\u0430\u043a\u0435\u0442 <a href=\"https:\/\/www.nuget.org\/Unchase.FluentPerformanceMeter.AspNetCore.Mvc\"><code>Unchase.FluentPerformanceMeter.AspNetCore.Mvc<\/code><\/a>, \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 <code>Startap.cs<\/code> \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">public void ConfigureServices(IServiceCollection services) {     \/\/ ...      \/\/ allows to measure methods performance for class &quot;MeasurableClass&quot; and &quot;MeasurableSecondClass&quot;     services.AddPerformanceDiagnosticObserver&lt;PerformanceClassDiagnosticObserver&lt;MeasurableClass&gt;&gt;();     services.AddPerformanceDiagnosticObserver&lt;PerformanceClassDiagnosticObserver&lt;MeasurableSecondClass&gt;&gt;();     \/\/ ... the same for another classes      services.AddMvc();      \/\/ ... }  public void Configure(IApplicationBuilder app, IHostingEnvironment env) {     \/\/ ...      app.UsePerformanceDiagnosticObserver();      app.UseMvc(); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043f\u043e\u043c\u0435\u0442\u0438\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c <code>WatchingWithDiagnosticSourceAttribute<\/code> \u043b\u0438\u0431\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">[HttpGet(&quot;SimpleWatchingMethodStart&quot;)] [WatchingWithDiagnosticSource] public ActionResult SimpleWatchingMethodStart() {        return Ok(); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u043b\u0438\u0431\u043e \u0432\u0435\u0441\u044c \u043a\u043b\u0430\u0441\u0441:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">[ApiController] [Route(&quot;api\/v1\/[controller]&quot;)] [Produces(&quot;application\/json&quot;)] [SwaggerTag(&quot;Unchase.PerformanceMeter Test WebAPI Controller&quot;)] [WatchingWithDiagnosticSource] public class PerformanceMeterController : ControllerBase {     \/\/ measurable methods }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 <em>v1.2.0<\/em> \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0432\u044b\u0437\u043e\u0432\u0430 \u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u043c \u0437\u0430\u043c\u0435\u0440\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0432 <em>AspNetCore MVC<\/em> \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 <code>AddMethodArgumentsToCustomDataAttribute<\/code> \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 \u0441 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c <code>WatchingWithDiagnosticSourceAttribute<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">[HttpPost(&quot;SimpleWatchingMethodStartWithArgs&quot;)] [WatchingWithDiagnosticSource] [AddMethodArgumentsToCustomData(&quot;actionArguments&quot;)] public ActionResult SimpleWatchingMethodStartWithArgs(DTOArgument arg) {     return Ok(); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 <code>SimpleWatchingMethodStartWithArgs<\/code> \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 <code>GetPerformanceInfo<\/code> \u043f\u043e\u043b\u0443\u0447\u0438\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"json\">{   &quot;methodCalls&quot;: [     {       &quot;methodName&quot;: &quot;SimpleWatchingMethodStartWithArgs&quot;,       &quot;elapsed&quot;: &quot;00:00:00.0016350&quot;,       &quot;caller&quot;: &quot;unknown&quot;,       &quot;startTime&quot;: &quot;2019-12-06T10:27:27.3385385Z&quot;,       &quot;endTime&quot;: &quot;2019-12-06T10:27:27.3401735Z&quot;,       &quot;customData&quot;: {         &quot;actionArguments&quot;: {           &quot;arg&quot;: {             &quot;data&quot;: &quot;&lt;string_in_DTOArgument&gt;&quot;           }         }       },       &quot;steps&quot;: []     }   ],   &quot;totalActivity&quot;: [     {       &quot;methodName&quot;: &quot;SimpleWatchingMethodStartWithArgs&quot;,       &quot;callsCount&quot;: 1     }   ],   &quot;currentActivity&quot;: [     {       &quot;methodName&quot;: &quot;SimpleWatchingMethodStartWithArgs&quot;,       &quot;callsCount&quot;: 0     }   ],   &quot;uptimeSince&quot;: &quot;2019-12-06T10:27:27.3370183Z&quot;,   &quot;className&quot;: &quot;Unchase.FluentPerformanceMeter.TestWebAPI.Controllers.PerformanceMeterController&quot;,   &quot;methodNames&quot;: [     &quot;SimpleWatchingMethodStartWithArgs&quot;   ],   &quot;customData&quot;: {},   &quot;timerFrequency&quot;: 10000000 }<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"a-namesampleexternala-izmerenie-proizvoditelnosti-metoda-ispolzuemoy-biblioteki\"> \u0418\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/h3>\n<p>  <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0437\u0430\u043c\u0435\u0440\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c <em>public<\/em> \u043c\u0435\u0442\u043e\u0434\u0430 <em>public<\/em> \u043a\u043b\u0430\u0441\u0441\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u044f\u0432\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0441\u0430\u043c \u043a\u043b\u0430\u0441\u0441 \u0438 \u0438\u043c\u044f \u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">[HttpGet(&quot;GetThreadSleepPerformance&quot;)] public ActionResult&lt;string&gt; GetThreadSleepPerformance() {     using (PerformanceMeter&lt;Thread&gt;.WatchingMethod(nameof(Thread.Sleep)).Start())     {         Thread.Sleep(1000);     }      return Ok(PerformanceMeter&lt;Thread&gt;.PerformanceInfo.MethodCalls.FirstOrDefault(ta =&gt; ta.MethodName == nameof(Thread.Sleep))?.Elapsed); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0432\u0435\u0440\u043d\u0451\u0442:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">&quot;00:00:01.0033040&quot;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0432\u044b\u0437\u043e\u0432\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0447\u0435\u0440\u0435\u0437 \u0432\u044b\u0437\u043e\u0432:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">\/\/\/ &lt;summary&gt; \/\/\/ Get methods performance info for Thread class. \/\/\/ &lt;\/summary&gt; \/\/\/ &lt;returns&gt;Returns Thread methods performance info.&lt;\/returns&gt; [HttpGet(&quot;GetThreadPerformanceInfo&quot;)] [IgnoreMethodPerformance] public ActionResult&lt;IPerformanceInfo&gt; GetThreadPerformanceInfo() {     return Ok(PerformanceMeter&lt;Thread&gt;.PerformanceInfo); }<\/code><\/pre>\n<p>  <\/p>\n<blockquote><p>\u0410\u0442\u0440\u0438\u0431\u0443\u0442 <code>IgnoreMethodPerformance<\/code> \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0439 \u0438\u043c \u043c\u0435\u0442\u043e\u0434 \u043d\u0435 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u043b\u0441\u044f \u043f\u0440\u0438 \u0437\u0430\u043c\u0435\u0440\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p><\/blockquote>\n<p>\u0412 \u043e\u0442\u0432\u0435\u0442\u0435 \u043d\u0430 \u0432\u044b\u0437\u043e\u0432 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0431\u0443\u0434\u0435\u0442:<\/p>\n<p>  <\/p>\n<pre><code class=\"json\">{   &quot;methodCalls&quot;: [     {       &quot;methodName&quot;: &quot;Sleep&quot;,       &quot;elapsed&quot;: &quot;00:00:01.0033040&quot;,       &quot;caller&quot;: &quot;unknown&quot;,       &quot;startTime&quot;: &quot;2019-12-06T13:08:09.336624Z&quot;,       &quot;endTime&quot;: &quot;2019-12-06T13:08:10.339928Z&quot;,       &quot;customData&quot;: {},       &quot;steps&quot;: []     }   ],   &quot;totalActivity&quot;: [     {       &quot;methodName&quot;: &quot;Abort&quot;,       &quot;callsCount&quot;: 0     },     \/\/ ...     {       &quot;methodName&quot;: &quot;Sleep&quot;,       &quot;callsCount&quot;: 1     }     \/\/ ...   ],   &quot;currentActivity&quot;: [     {       &quot;methodName&quot;: &quot;Abort&quot;,       &quot;callsCount&quot;: 0     },     \/\/ ...     {       &quot;methodName&quot;: &quot;Sleep&quot;,       &quot;callsCount&quot;: 1     }     \/\/ ...   ],   &quot;uptimeSince&quot;: &quot;2019-12-06T13:08:09.3357028Z&quot;,   &quot;className&quot;: &quot;System.Threading.Thread&quot;,   &quot;methodNames&quot;: [     &quot;Abort&quot;,     \/\/ ...     &quot;Sleep&quot;,     \/\/ ...   ],   &quot;customData&quot;: {},   &quot;timerFrequency&quot;: 10000000 }<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"a-namesamplecustomdataa-dobavlenie-dopolnitelnyh-dannyh-custom-data-i-razbienie-na-shagi-steps\"> \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 (Custom Data) \u0438 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0435 \u043d\u0430 \u0448\u0430\u0433\u0438 (Steps)<\/h3>\n<p>  <\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 (Custom Data) \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u043a\u043b\u0430\u0441\u0441\u0430-\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 <code>PerformanceMeterController<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">[ApiController] [Route(&quot;api\/v1\/[controller]&quot;)] public class PerformanceMeterController : ControllerBase {     \/\/\/ &lt;summary&gt;     \/\/\/ Static constructor.     \/\/\/ &lt;\/summary&gt;     static PerformanceMeterController()     {         \/\/ add common custom data (string) to class performance information         PerformanceMeter&lt;PerformanceMeterController&gt;.AddCustomData(&quot;Tag&quot;, &quot;CustomTag&quot;);          \/\/ add common custom data (anonymous class) to class performance information         PerformanceMeter&lt;PerformanceMeterController&gt;.AddCustomData(&quot;Custom anonymous class&quot;, new { Name = &quot;Custom Name&quot;, Value = 1 });     }      \/\/ ... actions }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 (Custom Data) \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u0437\u0430\u043c\u0435\u0440\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f <code>.WithSettingData.CustomData(&quot;&lt;key&gt;&quot;, &lt;value&gt;)<\/code> (\u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435, \u0447\u0435\u0440\u0435\u0437 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u043c\u0435\u0442\u043e\u0434\u0430 <code>MethodCustomDataAttribute<\/code>) \u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0448\u0430\u0433\u0430 (Step) \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u043c\u0435\u0440\u0430, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f <code>.Step(&quot;&lt;step_name&gt;&quot;)<\/code>, \u2014 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f <code>.AddCustomData(&quot;&lt;key&gt;&quot;, &lt;value&gt;)<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">\/\/\/ &lt;summary&gt; \/\/\/ Test GET method with simple performance watching (with steps). \/\/\/ &lt;\/summary&gt; [HttpGet(&quot;SimpleStartWatchingWithSteps&quot;)] [MethodCustomData(&quot;Custom data from attribute&quot;, &quot;Attr&quot;)] public ActionResult SimpleStartWatchingWithSteps() {     using (var pm = PerformanceMeter&lt;PerformanceMeterController&gt;         .WatchingMethod()         .WithSettingData             .CustomData(&quot;coins&quot;, 1)             .CustomData(&quot;Coins sets&quot;, new              {                  Gold = &quot;Many&quot;,                 Silver = 5             })         .Start())     {         \/\/ put your code with some logic here          \/\/ add &quot;Step 1&quot;         using (pm.Step(&quot;Step 1&quot;))         {             Thread.Sleep(1000);         }          \/\/ add &quot;Step 2&quot; with custom data         using (var pmStep = pm.Step(&quot;Step 2&quot;).AddCustomData(&quot;step2 custom data&quot;, &quot;data!&quot;))         {             \/\/ add &quot;Step 3 in Step 2&quot;             using (pm.Step(&quot;Step 3 in Step 2&quot;))             {                 Thread.Sleep(1000);             }              \/\/ add custom data to &quot;Step 2&quot;             pmStep.AddCustomData(&quot;step2 another custom data&quot;, &quot;data2!&quot;);              \/\/ get and remove custom data from &quot;Step 2&quot;             var customData = pmStep.GetAndRemoveCustomData&lt;string&gt;(&quot;step2 custom data&quot;);              \/\/ get custom data from &quot;Step 2&quot; (without removing)             var anotherCustomData = pmStep.GetCustomData&lt;string&gt;(&quot;step2 another custom data&quot;);              \/\/ ...         }     } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 <code>GetPerformanceInfo<\/code> \u043f\u043e\u043b\u0443\u0447\u0438\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"json\">{   &quot;methodCalls&quot;: [     {       &quot;methodName&quot;: &quot;SimpleStartWatchingWithSteps&quot;,       &quot;elapsed&quot;: &quot;00:00:02.0083031&quot;,       &quot;caller&quot;: &quot;unknown&quot;,       &quot;startTime&quot;: &quot;2019-12-06T11:58:18.9006891Z&quot;,       &quot;endTime&quot;: &quot;2019-12-06T11:58:20.9089922Z&quot;,       &quot;customData&quot;: {         &quot;Coins sets&quot;: {           &quot;gold&quot;: &quot;Many&quot;,           &quot;silver&quot;: 5         },         &quot;coins&quot;: 1,         &quot;Custom data from attribute&quot;: &quot;Attr&quot;       },       &quot;steps&quot;: [         {           &quot;stepName&quot;: &quot;Step 1&quot;,           &quot;elapsed&quot;: &quot;00:00:01.0009758&quot;,           &quot;startTime&quot;: &quot;2019-12-06T11:58:18.9018272Z&quot;,           &quot;endTime&quot;: &quot;2019-12-06T11:58:19.902803Z&quot;,           &quot;customData&quot;: {}         },         {           &quot;stepName&quot;: &quot;Step 3 in Step 2&quot;,           &quot;elapsed&quot;: &quot;00:00:01.0004549&quot;,           &quot;startTime&quot;: &quot;2019-12-06T11:58:19.9046523Z&quot;,           &quot;endTime&quot;: &quot;2019-12-06T11:58:20.9051072Z&quot;,           &quot;customData&quot;: {}         },         {           &quot;stepName&quot;: &quot;Step 2&quot;,           &quot;elapsed&quot;: &quot;00:00:01.0029596&quot;,           &quot;startTime&quot;: &quot;2019-12-06T11:58:19.904534Z&quot;,           &quot;endTime&quot;: &quot;2019-12-06T11:58:20.9074936Z&quot;,           &quot;customData&quot;: {             &quot;step2 another custom data&quot;: &quot;data2!&quot;           }         }       ]     }   ],   &quot;totalActivity&quot;: [     {       &quot;methodName&quot;: &quot;SimpleStartWatchingWithSteps&quot;,       &quot;callsCount&quot;: 1     }   ],   &quot;currentActivity&quot;: [     {       &quot;methodName&quot;: &quot;SimpleStartWatchingWithSteps&quot;,       &quot;callsCount&quot;: 0     }   ],   &quot;uptimeSince&quot;: &quot;2019-12-06T11:58:18.8801249Z&quot;,   &quot;className&quot;: &quot;Unchase.FluentPerformanceMeter.TestWebAPI.Controllers.PerformanceMeterController&quot;,   &quot;methodNames&quot;: [     &quot;SimpleStartWatchingWithSteps&quot;   ],   &quot;customData&quot;: {     &quot;Tag&quot;: &quot;CustomTag&quot;,     &quot;Custom anonymous class&quot;: {       &quot;name&quot;: &quot;Custom Name&quot;,       &quot;value&quot;: 1     }   },   &quot;timerFrequency&quot;: 10000000 }<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"a-namesampleignorea-isklyuchenie-iz-zamera-ignore\"> \u0418\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u0437\u0430\u043c\u0435\u0440\u0430 (Ignore)<\/h3>\n<p>  <\/p>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0435 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0432 \u0437\u0430\u043c\u0435\u0440\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 (\u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>.Ignore()<\/code> \u0438\u043b\u0438 <code>.Executing().WithoutWatching().Start(&lt;Action&gt;)<\/code>), \u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0448\u0430\u0433\u0438 (\u043c\u0435\u0442\u043e\u0434 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f <code>.StepIf(&quot;&lt;step_name&gt;&quot;, &lt;minSaveMs&gt;)<\/code>), \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u043d\u0435 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u044e\u0442 \u0443\u0441\u043b\u043e\u0432\u0438\u044e (\u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0448\u0430\u0433\u0430 \u0431\u0443\u0434\u0435\u0442 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430):<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">using (var pm = PerformanceMeter&lt;PerformanceMeterController&gt;.WatchingMethod().Start()) {     \/\/ put your code with some logic here      \/\/ sleep 1 sec     Thread.Sleep(1000);      \/\/ ignore this block in performance watching     using (pm.Ignore())     {         Thread.Sleep(5000);     }      \/\/ skip this step with minSaveMs (not save, but consider duration in method performance watching)     using (pm.StepIf(&quot;Skipped step&quot;, minSaveMs: 1000))     {         Thread.Sleep(500);     }      \/\/ execute action without performance watching     pm.Executing().WithoutWatching().Start(() =&gt;      {         Thread.Sleep(2000);     });      return Ok(); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"json\">{   &quot;methodCalls&quot;: [     {       &quot;methodName&quot;: &quot;SimpleStartWatchingWithIgnored&quot;,       &quot;elapsed&quot;: &quot;00:00:01.5080227&quot;,       &quot;caller&quot;: &quot;unknown&quot;,       &quot;startTime&quot;: &quot;2019-12-06T12:34:36.9187359Z&quot;,       &quot;endTime&quot;: &quot;2019-12-06T12:34:38.4267586Z&quot;,       &quot;customData&quot;: {},       &quot;steps&quot;: []     }   ],   &quot;totalActivity&quot;: [     {       &quot;methodName&quot;: &quot;SimpleStartWatchingWithIgnored&quot;,       &quot;callsCount&quot;: 1     }   ],   &quot;currentActivity&quot;: [     {       &quot;methodName&quot;: &quot;SimpleStartWatchingWithIgnored&quot;,       &quot;callsCount&quot;: 0     }   ],   &quot;uptimeSince&quot;: &quot;2019-12-06T12:34:36.9035129Z&quot;,   &quot;className&quot;: &quot;Unchase.FluentPerformanceMeter.TestWebAPI.Controllers.PerformanceMeterController&quot;,   &quot;methodNames&quot;: [     &quot;SimpleStartWatchingWithIgnored&quot;   ],   &quot;customData&quot;: { },   &quot;timerFrequency&quot;: 10000000 }<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"a-namesamplecustomcommandsa-dobavlenie-komand-commands-i-deystviy-actions\"> \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434 (Commands) \u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 (Actions)<\/h3>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u043f\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u0437\u0430\u043c\u0435\u0440\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u0430, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 <code>IPerformanceCommand<\/code>.<br \/>  \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u043f\u0440\u0438 \u0435\u0451 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">\/\/\/ &lt;summary&gt; \/\/\/ Custom executed command. \/\/\/ &lt;\/summary&gt; public class ExecutedCommand : IPerformanceCommand {     \/\/\/ &lt;summary&gt;     \/\/\/ Executed commad name.     \/\/\/ &lt;\/summary&gt;     public string CommandName =&gt; this.GetType().Name;      private string _customString { get; }      internal bool IsCommandExecuted { get; private set; }      \/\/\/ &lt;summary&gt;     \/\/\/ Constructor.     \/\/\/ &lt;\/summary&gt;     \/\/\/ &lt;remarks&gt;     \/\/\/ You can pass any data through the command constructor.     \/\/\/ &lt;\/remarks&gt;     \/\/\/ &lt;param name=&quot;customString&quot;&gt;&lt;\/param&gt;     public ExecutedCommand(string customString)      {         this._customString = customString;     }      \/\/\/ &lt;summary&gt;     \/\/\/ Execute command.     \/\/\/ &lt;\/summary&gt;     \/\/\/ &lt;param name=&quot;performanceInfo&quot;&gt;&lt;see cref=&quot;IPerformanceInfo&quot;\/&gt;.&lt;\/param&gt;     public void Execute(IPerformanceInfo performanceInfo)     {         \/\/ for example, write to the debug console some information         Debug.WriteLine(this.CommandName);         Debug.WriteLine(this._customString);         Debug.WriteLine($&quot;Method names count: {performanceInfo.MethodNames.Count}&quot;);         this.IsCommandExecuted = true;     } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 (IPerformanceCommand) \u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 (Action), \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b\u0438\u0441\u044c \u043f\u043e \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0438 \u0437\u0430\u043c\u0435\u0440\u0430, \u043c\u043e\u0436\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">\/\/ custom &quot;ExecutedCommand&quot; will be executed after performance watching is completed using (PerformanceMeter&lt;PerformanceMeterController&gt;     .WatchingMethod()     .WithExecutingOnComplete         .Command(new ExecutedCommand(&quot;bla-bla-bla&quot;))         .Action((pi) =&gt;         {             Debug.WriteLine($&quot;Class name: {pi.ClassName}&quot;);         })     .Start()) {     return Ok(); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435, \u043f\u043e \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044e \u0437\u0430\u043c\u0435\u0440\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 \u0432 <em>Debug<\/em>-\u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0432\u0435\u0434\u0435\u043d\u043e:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">ExecutedCommand bla-bla-bla Method names count: 13 Class name: Unchase.FluentPerformanceMeter.TestWebAPI.Controllers.PerformanceMeterController<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"a-namesamplecustomexceptionhandlera-dobavlenie-obrabotchikov-isklyucheniy-exception-handlers\"> \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 (Exception Handlers)<\/h3>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0447\u0430\u0441\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u0430, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 (Exception handler) \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">using (var pm = PerformanceMeter&lt;PerformanceMeterController&gt;.StartWatching()) {     \/\/ execute action throws Exception with exception handler     pm.Executing()         .WithExceptionHandler((ex) =&gt; Debug.WriteLine(ex.Message))         .Start(() =&gt; throw new Exception(&quot;Exception&quot;));      \/\/ execute action throws custom Exception with exception handler     pm.Executing&lt;CustomException&gt;()        .WithExceptionHandler((ex) =&gt; { Debug.WriteLine(ex.Message); })        .Start(() =&gt;        {            throw new CustomException(&quot;Custom exception was occured!&quot;);        });      return Ok(); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0413\u0434\u0435 \u043a\u043b\u0430\u0441\u0441 <code>CustomException<\/code>, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">\/\/\/ &lt;summary&gt; \/\/\/ Custom exception. \/\/\/ &lt;\/summary&gt; public class CustomException : Exception {     public CustomException(string message) : base(message) { }      public CustomException(string message, Exception innerException) : base(message, innerException) { }      public CustomException() { } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432 <em>Debug<\/em>-\u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0432\u0435\u0434\u0435\u043d\u043e:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">Exception Custom exception was occured!<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0434\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u043b\u044f \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043b\u044e\u0431\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0435\u0440\u0435\u0437 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043a\u043b\u0430\u0441\u0441\u0430-\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 <code>PerformanceMeterController<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">[ApiController] [Route(&quot;api\/v1\/[controller]&quot;)] public class PerformanceMeterController : ControllerBase {     \/\/\/ &lt;summary&gt;     \/\/\/ Static constructor.     \/\/\/ &lt;\/summary&gt;     static PerformanceMeterController()     {         \/\/ set default exception handler for PerformanceMeterController class         PerformanceMeter&lt;PerformanceMeterController&gt;.SetDefaultExceptionHandler((ex) =&gt; Debug.WriteLine(ex.Message));     }      \/\/ ... actions }<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"a-namesamplesettingcachetimea-ustanovka-vremeni-hraneniya-dannyh-set-cache-time\"> \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 (Set Cache Time)<\/h3>\n<p>  <\/p>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u043f\u043e \u0438\u0441\u0442\u0435\u0447\u0435\u043d\u0438\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0443\u0434\u0430\u043b\u0435\u043d\u044b. \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0437\u0430\u043c\u0435\u0440, \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u0440\u0435\u043c\u044f \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043a\u043b\u0430\u0441\u0441\u0430-\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 <code>PerformanceMeterController<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">[ApiController] [Route(&quot;api\/v1\/[controller]&quot;)] public class PerformanceMeterController : ControllerBase {     \/\/\/ &lt;summary&gt;     \/\/\/ Static constructor.     \/\/\/ &lt;\/summary&gt;     static PerformanceMeterController()     {         \/\/ set cache time for PerformanceMeterController class         PerformanceMeter&lt;PerformanceMeterController&gt;.SetMethodCallsCacheTime(5);     }      \/\/ ... actions }<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"a-namesamplesetcallerandsourcewithstopa-dobavlenie-dannyh-o-vyzyvayuschem-metod-i-meste-vyzova-i-preryvanie-zamera-proizvoditelnosti\"> \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0435\u043c \u043c\u0435\u0442\u043e\u0434 \u0438 \u043c\u0435\u0441\u0442\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 (\u0438 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435 \u0437\u0430\u043c\u0435\u0440\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438)<\/h3>\n<p>  <\/p>\n<ul>\n<li>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0434\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0442\u043e\u043c, \u043a\u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043c\u0435\u0442\u043e\u0434, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f <code>.CallerFrom(&quot;&lt;caller_name&gt;&quot;)<\/code> (\u0435\u043c\u0443 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u043b\u0438\u0431\u043e \u0441\u0442\u0440\u043e\u043a\u0430, \u043b\u0438\u0431\u043e <em>IHttpContextAccessor<\/em>) \u0438\u043b\u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 <code>[MethodCaller(&quot;&lt;caller_name&gt;&quot;)]<\/code>. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c, \u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0438 \u043c\u0435\u0442\u043e\u0434 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f, \u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0438\u0437 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e.<\/p>\n<p>  <\/li>\n<li>\n<p>\u0414\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043c\u0435\u0441\u0442\u0430 \u0432\u044b\u0437\u043e\u0432\u0430 \u0437\u0430\u043c\u0435\u0440\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f <code>.WithSettingData.CallerSourceData()<\/code>.<\/p>\n<p>  <\/li>\n<li>\n<p>\u0414\u043b\u044f \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0437\u0430\u043c\u0435\u0440\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u0431\u043b\u043e\u043a\u0430 <code>using<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f <code>.StopWatching()<\/code> \u0438\u043b\u0438 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043c\u0435\u0442\u043e\u0434 <code>Dispose()<\/code>:<\/p>\n<p>  <\/li>\n<\/ul>\n<p>  <\/p>\n<pre><code class=\"plaintext\">[HttpPost(&quot;StartWatchingWithCallerName&quot;)] [MethodCaller(&quot;testCaller&quot;)] public ActionResult&lt;string&gt; StartWatchingWithCallerName([FromBody] string value) {     \/\/ method performance info will reach with caller name (if internal HttpContextAccessor is null)     using (var pm = PerformanceMeter&lt;PerformanceMeterController&gt;         .WatchingMethod()         .WithSettingData             .CallerSourceData()             .CallerFrom(&quot;Test caller&quot;)         .Start())     {         pm.StopWatching(); \/\/ stop watching here (or you can use &quot;pm.Dispose();&quot;)         Thread.Sleep(2000);          return Ok(value);     } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 <code>GetPerformanceInfo<\/code> \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"json\">{   &quot;methodCalls&quot;: [     {       &quot;methodName&quot;: &quot;StartWatchingWithCallerName&quot;,       &quot;elapsed&quot;: &quot;00:00:00.0019172&quot;,       &quot;caller&quot;: &quot;Test caller&quot;,       &quot;startTime&quot;: &quot;2019-12-06T13:35:45.3164507Z&quot;,       &quot;endTime&quot;: &quot;2019-12-06T13:35:45.3183679Z&quot;,       &quot;customData&quot;: {         &quot;customData123&quot;: 123,         &quot;callerSourceLineNumber&quot;: 525,         &quot;callerSource&quot;: &quot;D:\\\\GitHub\\\\Unchase.FluentPerformanceMeter\\\\Unchase.FluentPerformanceMeter.TestWebAPI\\\\Controllers\\\\PerformanceMeterController.cs&quot;       },       &quot;steps&quot;: []     }   ],   &quot;totalActivity&quot;: [     {       &quot;methodName&quot;: &quot;StartWatchingWithCallerName&quot;,       &quot;callsCount&quot;: 1     }   ],   &quot;currentActivity&quot;: [     {       &quot;methodName&quot;: &quot;StartWatchingWithCallerName&quot;,       &quot;callsCount&quot;: 0     }   ],   &quot;uptimeSince&quot;: &quot;2019-12-06T13:35:45.2601668Z&quot;,   &quot;className&quot;: &quot;Unchase.FluentPerformanceMeter.TestWebAPI.Controllers.PerformanceMeterController&quot;,   &quot;methodNames&quot;: [     &quot;StartWatchingWithCallerName&quot;   ],   &quot;customData&quot;: { },   &quot;timerFrequency&quot;: 10000000 }<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"zaklyuchenie\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0442\u0447\u0430\u0441\u0442\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0431\u043e\u0440 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 .NET \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c. \u0421\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443.<\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043d\u0435 \u0440\u0435\u0448\u0430\u0430\u0435\u0442 \u0432\u0441\u0435 \u0437\u0430\u0434\u0430\u0447\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441\u043e \u0441\u0431\u043e\u0440\u043e\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u043d\u043e \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u0441\u044f \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0447\u0430\u0441\u0442\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0438\u0437 \u043d\u0438\u0445.<\/p>\n<p>  <\/p>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f open-source \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c, \u043b\u044e\u0431\u044b\u0435 \u043f\u043e\u0436\u0435\u043b\u0430\u043d\u0438\u044f \u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u0435\u0451 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442\u0441\u044f, \u043a\u0430\u043a \u0438 bug-report&#8217;\u044b (\u0432\u0441\u0435 \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043f\u043e <a href=\"https:\/\/github.com\/unchase\/Unchase.FluentPerformanceMeter\/issues\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a>; \u0430\u0432\u0442\u043e\u0440 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0437\u043d\u0430\u0442\u0435\u043b\u0435\u043d \u0437\u0430 \u043b\u044e\u0431\u0443\u044e \u043f\u043e\u043c\u043e\u0449\u044c!).<\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/485198\/\"> https:\/\/habr.com\/ru\/post\/485198\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/485198\/\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/-q\/hs\/z8\/-qhsz8oawswkr7chwsijjbkrr1y.png\"\/><\/p>\n<p>  <\/p>\n<p>\u0417\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u043f\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 (\u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0443\u0436\u0435 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043e), \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u044f\u0432\u043b\u044f\u0442\u044c \u0435\u0433\u043e \u0443\u0437\u043a\u0438\u0435 \u043c\u0435\u0441\u0442\u0430, \u0438 \u0432\u0438\u0434\u0435\u0442\u044c, \u043a\u0430\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0442\u043e\u0440\u043c\u043e\u0437\u0438\u0442.<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u043f\u043e\u043c\u0438\u043c\u043e \u0441\u0430\u043c\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 (\u0432\u0440\u0435\u043c\u044f \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043c\u0435\u0442\u043e\u0434\u0430, \u0434\u0430\u0442\u0430 \u043d\u0430\u0447\u0430\u043b\u0430 \u0438 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u0435\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430) \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0432\u044b\u0437\u043e\u0432\u0430, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c (\u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u043c \u0434\u0430\u043d\u043d\u044b\u0435).<\/p>\n<p>  <\/p>\n<p>\u041d\u0443 \u0438 &quot;\u0432\u0438\u0448\u0435\u043d\u043a\u043e\u0439 \u043d\u0430 \u0442\u043e\u0440\u0442\u0435&quot; \u043c\u043e\u0436\u043d\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430, \u0447\u0442\u043e \u0442\u043e\u0436\u0435 \u043d\u0435\u043c\u0430\u043b\u043e\u0432\u0430\u0436\u043d\u043e.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u0438 \u0431\u044b\u043b\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u0430 \u043a\u0440\u043e\u0441\u0441-\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u0430\u044f open-source .NET \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <a href=\"https:\/\/github.com\/unchase\/Unchase.FluentPerformanceMeter\">Unchase.FluentPerformanceMeter<\/a>.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-297561","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/297561","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=297561"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/297561\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=297561"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=297561"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=297561"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}