Javaでログのライブラリ、何を使ってますか? 今自分は、slf4j + logback を使っています。 ざっくばらんにログに関してまとめておこうと思います。
この記事ではロギングでどう出力すれば良いログになるかについては、話しません。
自分が採用したログのライブラリの話をする前に、Spring Bootの構造化ロギングの話を少ししておきます。 Spring Boot 3.4では、Spring Boot標準で構造化ロギングの実装されており
| package com.github.wreulicke.mdc; | |
| import org.slf4j.MDC; | |
| import java.util.List; | |
| import java.util.Map; | |
| import java.util.concurrent.*; | |
| public class DelegatingMDCInheritableExecutorService extends AbstractExecutorService { |
| import org.slf4j.bridge.SLF4JBridgeHandler; | |
| public class Main { | |
| public static void main(String[] args) { | |
| // java.util.loggingのロガーをslf4jに入れ替えている | |
| SLF4JBridgeHandler.removeHandlersForRootLogger(); | |
| SLF4JBridgeHandler.install(); | |
| } | |
| } |
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "os" | |
| "strings" | |
| "github.com/awalterschulze/gographviz" | |
| ) |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
| <modelVersion>4.0.0</modelVersion> | |
| <groupId>com.github</groupId> | |
| <artifactId>maven-test-child</artifactId> | |
| <version>1.0-SNAPSHOT</version> |
| #!/bin/sh | |
| # Detected container limits | |
| # If found these are exposed as the following environment variables: | |
| # | |
| # - CONTAINER_MAX_MEMORY | |
| # - CONTAINER_CORE_LIMIT | |
| # | |
| # This script is meant to be sourced. |
| const async_hooks = require('async_hooks') | |
| const map = new Map() | |
| let beforeCount = 0 | |
| let afterCount = 0 | |
| const hook = async_hooks.createHook({ | |
| init(asyncId, type, triggerAsyncId, resource) { | |
| const context = map.get(triggerAsyncId) |
https://github.com/google/pprof/tree/acf8798be1f76c82483eaa0daf3fc93ab3d493b6/proto/README.md の和訳
========================================================
これは profile.proto のフォーマットの説明です。
Profile.protoはプロファイルデータのデータ表現です。これは集められたりしたデータのタイプや、データを集めるために用いられたサンプリングプロセスに非依存で
https://mjambon.com/2016-07-23-moving-percentile/ の和訳です。
これは exponential moving average (指数平滑移動平均)と同じ制約によって駆動する手法ですが 中央値やパーセンタイル値のための手法です。 時間によって分布の変化するような観察結果の無限ストリームにおける中央値などのパーセンタイルのトラッキングのためにアルゴリズムを示します。 自ら課した制約はメモリに直近のNの観察結果を明示的に持つことを与えません。 私達のアルゴリズムでは、予測されたパーセンタイルのアップデートのコストはO(1)でそのメモリ使用量もまたO(1)です。
| MIT License | |
| Copyright (c) 2020 wreulicke | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is | |
| furnished to do so, subject to the following conditions: |