From 1916a2e2528304bf1804ccaec6ff9538a9e5e2eb Mon Sep 17 00:00:00 2001 From: kingluo Date: Thu, 15 Dec 2022 15:40:06 +0800 Subject: [PATCH] fix PR --- conf/config-default.yaml | 2 +- docs/en/latest/plugins/inspect.md | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/conf/config-default.yaml b/conf/config-default.yaml index 3947e9bf5e1f..cc9d0fe60b24 100755 --- a/conf/config-default.yaml +++ b/conf/config-default.yaml @@ -557,7 +557,7 @@ plugin_attr: # redirect: # https_port: 8443 # the default port for use by HTTP redirects to HTTPS inspect: - delay: 3 + delay: 3 # in seconds hooks_file: "/var/run/apisix_inspect_hooks.lua" deployment: diff --git a/docs/en/latest/plugins/inspect.md b/docs/en/latest/plugins/inspect.md index fd667fe1a7b1..43fa0fd346a4 100644 --- a/docs/en/latest/plugins/inspect.md +++ b/docs/en/latest/plugins/inspect.md @@ -3,8 +3,8 @@ title: inspect keywords: - APISIX - Plugin - - inspect - - inspect + - Inspect + - Dynamic Lua Debugging description: This document contains information about the Apache APISIX inspect Plugin. --- @@ -29,7 +29,7 @@ description: This document contains information about the Apache APISIX inspect ## Description -It's useful to set arbitrary breakpoint in any lua file to inspect the context information, +It's useful to set arbitrary breakpoint in any Lua file to inspect the context information, e.g. print local variables if some condition satisfied. In this way, you don't need to modify the source code of your project, and just get diagnose information @@ -40,13 +40,13 @@ The breakpoint could be at any position within the function. The function could ## Features -* set breakpoint at any position -* dynamic breakpoint -* Customized breakpoint handler -* you could define one-shot breakpoint -* work for jit compiled function -* if function reference specified, then performance impact is only bound to that function (JIT compiled code will not trigger debug hook, so they would run fast even if hook is enabled) -* if all breakpoints deleted, jit could recover +* Set breakpoint at any position +* Dynamic breakpoint +* customized breakpoint handler +* You could define one-shot breakpoint +* Work for jit compiled function +* If function reference specified, then performance impact is only bound to that function (JIT compiled code will not trigger debug hook, so they would run fast even if hook is enabled) +* If all breakpoints deleted, jit could recover ## Operation Graph @@ -65,7 +65,7 @@ global function, you should set it that function reference, then only the jit ca be flushed, and it would not affect other caches to avoid slowing down other parts of the program. * If the breakpointis related to local function or anonymous function, -then you have to set it to `nil` (because no way to get function reference), which would flush the whole jit cache of lua vm. +then you have to set it to `nil` (because no way to get function reference), which would flush the whole jit cache of Lua vm. You attach a `filter_func` function of the breakpoint, the function takes the `info` as argument and returns true of false to determine whether the breakpoint would be removed. You could setup one-shot breakpoint @@ -82,7 +82,7 @@ The `info` is a hash table which contains below keys: | Name | Type | Required | Default | Description | |--------------------|---------|----------|---------|------------------------------------------------------------------------------------------------| | delay | integer | False | 3 | Time in seconds specifying how often to check the hooks file. | -| hooks_file | string | False | "/var/run/apisix_inspect_hooks.lua" | lua file to define hooks, which could be a link file. | +| hooks_file | string | False | "/var/run/apisix_inspect_hooks.lua" | Lua file to define hooks, which could be a link file. | ## Enabling the Plugin @@ -125,7 +125,7 @@ curl http://127.0.0.1:9180/apisix/admin/routes/test_limit_req -H 'X-API-KEY: edd # create a hooks file to set a test breakpoint # Note that the breakpoint is associated with the line number, -# so if the lua code changes, you need to adjust the line number in the hooks file +# so if the Lua code changes, you need to adjust the line number in the hooks file cat </tmp/hooks.lua local dbg = require "resty.inspect.dbg"