vehicle_inventory_management

command
v0.0.0-...-b03bf0d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2023 License: MIT Imports: 7 Imported by: 0

README

1.The above web service are shown in the code. 2.Please describe how would you monitor above inventory management program after it was deployed in production environment. 请描述在生产环境中部署库存管理程序后,您将如何监控上述库存管理程序。 可以基于prometheus进行服务监控。一般的监控分为多种形式,比如日志监控,调用链监控,指标监控等等。 在这个程序中,通过在http的中间件中添加了对请求指标的监控。主要从请求耗时和请求错误两个维度,请求耗时采用了Histogram指标类型定义了多个Buckets方便进行分位统计,请求错误采用了Counter类型,并添加了method标签以便进行细分监控。 After the service is online, we often need to monitor the service so that we can find the problem early and make targeted optimization. The monitoring can be divided into various forms, such as log monitoring, call chain monitoring, indicator monitoring, and so on. Service monitoring can be performed based on prometheus. In this program, the monitoring of request metrics is added to the http middleware. mainly from the two dimensions of request time-consuming and request error, the request time-consuming uses the Histogram indicator type to define multiple Buckets to facilitate bit statistics, the request error uses the Counter type, and adds the method tag for subdivision monitoring.

补充: 基础监控,cpu,memory,disk,如果运行在容器里面就是pod的监控 服务端监控, 业务监控,监控出来的R,inventory等指标可以绘成图,然后从业务角度出发,看值变化的趋势能分析出来有价值的信息,比如一天不同时间段售卖率,不同季节售卖率分析出来啥之类的

3.Please describe how would you optimize the above inventory management program. 请说明您将如何优化上述库存管理程序。 1 添加/pprof /metrics /healthcheck router 进行服务的性能分析,监控以及健康检查 2 并发控制和限流以及熔断,避免服务被突发流量击垮 3 多节点部署时,服务注册与服务发现,确保能够动态侦测增减的节点 4 进行负载均衡,根据节点承受能力分发流量 4 超时控制,避免对已超时请求做无用功 5 日志输出,用于数据收集和问题定位 1 Add/pprof /metrics /healthcheck router for service performance analysis, monitoring and health check. 2 Concurrency control, current limiting and fusing to prevent the service from being knocked down by sudden traffic. 3 When deploying multiple nodes, service registration and service discovery ensure that nodes that increase or
decrease can be detected dynamically. 4 Carry out load balancing and distribute traffic according to the capacity of nodes. 4 Timeout control to avoid useless work on timeout requests. 5 Log output for data collection and problem location.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL