简体   繁体   English

在多个服务/组件之间跟踪性能的最佳方法是什么

[英]What is the best way to track performance across multiple services/components

Our application consists of several services. 我们的应用程序包含几种服务。 Let's say: 比方说:

  1. An Authorization Service 授权服务
  2. Business Service Alpha 商业服务Alpha
  3. Business Service Beta 商业服务测试版
  4. Etc. 等等。

Most of these services are .Net, but not necessarily all of them. 这些服务大多数是.Net,但不一定全部。 Most are under are our control, however there two are external services and there may eventually be more. 大多数都在我们的控制之下,但是有两项外部服务,最终可能还会有更多。 Eventually, our .Net services will be moved into the cloud. 最终,我们的.Net服务将被迁移到云中。

End-to-end performance is important and right now, we're struggling to see the big picture of where the performance bottlenecks are. 端到端的性能非常重要,现在,我们正在努力查看性能瓶颈所在的概况。 A couple of ideas that we're considering are: 我们正在考虑的一些想法是:

  1. Creating a common log file that each of our .Net components will write to. 创建一个公共日志文件,我们的每个.Net组件都将写入该文件。 We will look for tools that can generate end-to-end waterfalls. 我们将寻找可以生成端到端瀑布的工具。
  2. Create an asynchronous logging service that will receive logging calls. 创建一个异步日志记录服务,它将接收日志记录调用。 We're not certain whether this would also write log files our use some other sort of storage. 我们不确定这是否还会写入日志文件,以便我们使用其他类型的存储。

For external services, we only expect the time called and the time returned, but for those services under our control, we want to track more granular events. 对于外部服务,我们仅期望调用的时间和返回的时间,但是对于那些在我们控制之下的服务,我们希望跟踪更详细的事件。

Any course of action will involve a bit of effort. 任何行动都将需要一些努力。 Before we begin, what pattern and/or tools do you think is the best way to provide effective performance data across multiple services. 在开始之前,您认为哪种模式和/或工具是跨多个服务提供有效性能数据的最佳方法。

The main question is: How much is it worth to you. 主要问题是:对您来说有多少价值。

There are plenty cloud or self host solutions on the marked which will allow you to track performance / errors and much more. 标有足够的云或自托管解决方案,可让您跟踪性能/错误等。

My only suggestion is: Don't reinvent the weel, take a prebuild solution. 我唯一的建议是:不要重新发明焊缝,采取预建解决方案。 The costs would propably be lower as if you would do it yourself. 成本可能会降低,就好像您自己动手做一样。

It's hard to answer your question without advertising but since you mentioned .NET 没有广告就很难回答您的问题,但是因为您提到了.NET

Microsoft offers something called Application Insight: https://azure.microsoft.com/en-us/documentation/articles/app-insights-windows-get-started/ 微软提供了一种称为应用程序洞察力的东西: https : //azure.microsoft.com/en-us/documentation/articles/app-insights-windows-get-started/

It's as simple as 就这么简单

 var tc = new TelemetryClient(); // Call once per thread

 // Send a user action or goal:
 tc.TrackEvent("Win Game");

 // Send a metric:
 tc.TrackMetric("Queue Length", q.Length);

 // Provide properties by which you can filter events:
 var properties = new Dictionary{"game", game.Name};

 // Provide metrics associated with an event:
 var measurements = new Dictionary{"score", game.score};

 tc.TrackEvent("Win Game", properties, measurements);

Take a look at it, compare some other tools and pick one that fits your needs. 看一看,比较其他一些工具,然后选择适合您需求的工具。

I've concluded that the following do-it-yourself option provides value: 我得出的结论是,以下“自己动手”选项提供了价值:

  1. Add a GUID that will flow throughout the process. 添加一个将在整个过程中流动的GUID。
  2. Add some type of toggle that can be used to turn on "verbose" logging on demand, for an individual request. 添加某种类型的切换,可用于为单个请求按需打开“详细”日志记录。
  3. When "verbose" logging has been chosen, create a single log file for that GUID and log the timings to a single event log. 选择“详细”日志记录后,请为该GUID创建单个日志文件,并将计时记录到单个事件日志中。

This is not an industrial strength solution, however when the individual components/services are under your control, it enables you to easily, at a glance, gain an understanding of the high level performance flow through the system. 这不是工业强度的解决方案,但是当您控制单个组件/服务时,它使您一眼就能轻松了解整个系统的高级性能。 This is useful during development. 这在开发过程中很有用。

As we discover which pieces of the puzzle cause the greatest bottlenecks, we will then turn to more specialized tools to analyze performance on a more granular basis. 当我们发现难题的哪些部分导致最大的瓶颈时,我们将转向更专门的工具来更精细地分析性能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在服务器之间分发服务的多个副本的最佳方法是什么? - What's the best way to distribute multiple copies of services across servers? 追踪独特访客的最佳方式是什么? - what is the best way to track unique visitors? 跟踪和降低GD手柄的最佳方法是什么? - What is the best way to track and lower GD handles? 性能:提高具有相同DisplayMemberPath和SelectedValuePath的多个组合框绑定性能的最佳方法是什么 - Performance : What is the best way to increase the performance of binding multiple comboboxes with same DisplayMemberPath and SelectedValuePath 限制某些用户的服务的最佳方法是什么 - what is the best way to restrict services for certain users 测试 WCF 服务的最佳方法是什么? - What's the best way to test WCF services? 在C#中,在多条源代码行之间散布单行字符串文字的最佳方法是什么? - In C#, what's the best way to spread a single-line string literal across multiple source lines? 调试性能问题的最佳方法是什么? - What is the best way to debug performance problems? 使用性能计数器跟踪Windows服务 - Using Performance Counters to track windows services 在多个项目中重用数据库访问以确保更新后不会破坏任何项目的最佳方法是什么? - What's the best way to reuse database access across multiple projects to ensure that when updated it does not break any projects?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM