Commit Graph

67 Commits

Author SHA1 Message Date
douxu 6f78d8e341 fix: improve measurement recommend validation and offset handling
- use unified response codes for measurement recommend handler
- reject recommend inputs with continuous dots as invalid params
- fix exact and continuation match offsets for recommend results
- preserve correct offsets for fallback recommend scenarios
- use hash-based confirmation for measurement token7 recommendations
- write component and bay token7 hash indexes for HEXISTS validation
- add tests for input validation, hash keys, and recommend offset cases
2026-07-09 16:31:19 +08:00
douxu 180b0f7843 test: cover initial recommend fallback inputs
- add coverage for leading-dot recommendation inputs
- verify normal recommendation inputs do not fallback to initial suggestions
2026-07-08 17:19:07 +08:00
douxu d8668afa46 refactor: simplify redis recommendation concurrency
- replace fan-in channel recommendation searches with errgroup-based execution
- return SearchResult directly from Redis recommendation helper functions
- fallback leading-dot recommendation input to initial token suggestions
- remove unused recommendLenType parameter from fuzzy member set validation
- clean up small model selection and naming issues
2026-07-08 14:41:13 +08:00
douxu f9824e2b24 fix: propagate request context through handlers
- pass c.Request.Context() to handler logs, DB calls, Redis wrappers,
and subscription operations
- avoid passing gin.Context into downstream model/database/diagram
layers
- keep async Redis backfill trace context without coupling it to request
cancellation
- add caller skip handling for facade logger output
2026-07-08 10:37:06 +08:00
douxu b53746efcd fix: improve redis recommendation fuzzy matching
- add bounded errgroup handling for attribute group suggestion initialization
- add config-level suggestions and propagate Redis/RediSearch write errors
- constrain fuzzy recommendation candidates by hierarchy-specific Redis sets
- avoid broad fallback results when concrete matches exist
- preserve full matched prefix when calculating fuzzy recommendation offset
- add tests for fuzzy recommendation offset calculation
2026-07-07 17:11:25 +08:00
douxu 305bdd4dcf fix: suppress fallback recommendations when concrete hits exist
- detect concrete recommend hits before normalizing results
- drop fallback results when any syntax path returns real candidates
- keep fallback candidates only when every path has no concrete hit
2026-07-03 15:59:53 +08:00
douxu 33eb2d9be8 feat: support nspath measurement shorthand recommendations
- add nspath-to-measurement recommend set keys and cleanup pattern
- collect nspath measurement tags when component nspath matches bay tag
- store token4.token7 autocomplete terms during measurement recommend init
- add token4.token7 recommendations alongside existing two-token paths
2026-07-02 13:49:47 +08:00
douxu 491c10e8c5 feat: add component column recommendations for config tokens
- add component as a token6 config recommendation constant
- read component table column names during startup
- bind component config recommendations to component table columns
- add full and local autocomplete terms for component column paths
2026-07-01 14:37:13 +08:00
douxu 66870c7008 fix: improve measurement recommend fallback and rune offsets
- fallback to all current-level candidates when fuzzy search has no result
- track fallback results and calculate fallback offsets from max rune length
- use rune-based prefix offsets and trimming for non-ASCII tokens
- reuse local nspath filtering for component nspath recommendations
2026-06-30 13:55:42 +08:00
douxu 367de31247 fix: flatten measurement recommend response and normalize offsets
- return a single measurement recommend payload instead of grouped payloads
- remove recommended_type from response schema and regenerated swagger docs
- normalize Redis recommend results in model layer with stable type ordering
- deduplicate trimmed recommend terms and preserve the maximum response offset
2026-06-29 14:13:58 +08:00
douxu c82ad773a3 refactor: lowercase channel name suffixes and rename PS to PF
- change all ChannelSuffix values from uppercase to lowercase
  - rename ChannelSuffixPS ("PS") to ChannelSuffixPF ("pf")
  - align channel suffix naming with downstream measurement keys
2026-06-17 10:47:35 +08:00
douxu 82622d0d85 refactor: add generic helpers and type-safe TypedMap wrapper
- add util.TypedMap, a generic wrapper over sync.Map to drop call-site type assertions
  - add generic util.MapSlice and reuse it in ConvertZSetMembersToFloat64
  - make GetKeysFromSet/SliceToSet/RemoveTargetsFromSliceSimple/DeduplicateAndReportDuplicates generic
  - migrate graphOverview to util.TypedMap[int64, *Graph]
  - build redis suggestions via util.MapSlice in measurement group recommend
2026-06-16 16:15:28 +08:00
douxu 57d1111a83 refactor: modernize Go idioms and add MongoDB K8s manifests
- replace interface{} with any across ~30 files for Go 1.18+ style
  - adopt for-range-over-int loops in place of explicit index loops
  - use maps.Copy from stdlib to replace manual map copy loops
  - use min() builtin for exponential backoff delay cap in retry_manager
  - add MongoDB 7.0 K8s manifests (StatefulSet, Service, PVC, Secret)
  - document PostgreSQL and MongoDB deploy steps in deploy.md with SSH tunnel port mappings
2026-05-29 14:28:58 +08:00
douxu 1b1f43db7f feat: implement topology analysis async task with BFS connectivity check
- add TopologyAnalysisHandler.Execute() with 5-phase BFS reachability
    check between start/end component UUIDs; support CheckInService flag
    to skip out-of-service nodes during traversal
  - carry task params through RabbitMQ message (TaskQueueMessage.Params)
    instead of re-querying DB in handler; update TaskHandler.Execute
    interface and all handler signatures accordingly
  - fix BuildMultiBranchTree UUIDFrom condition bug; return nodeMap for
    O(1) lookup; add QueryTopologicByStartUUID for directed traversal
  - add QueryBayByUUID/QueryBaysByUUIDs and
    QueryComponentsInServiceByUUIDs (two-column select) to database layer
  - add diagram.FindPath via LCA algorithm for tree path reconstruction
  - move initTracerProvider to middleware.InitTracerProvider; add
    OtelConfig struct to ModelRTConfig for endpoint configuration
  - update topology analysis params to start/end_component_uuid +
    check_in_service; remove dead topology init code
2026-04-24 17:14:46 +08:00
douxu 03bd058558 feat: implement end-to-end distributed tracing for HTTP and async tasks
- introduce typed traceCtxKey to prevent context key collisions (staticcheck fix)
  - inject B3 trace values into c.Request.Context() in StartTrace middleware
    so handlers using c.Request.Context() carry trace info
  - create startup trace context in main.go, replacing context.TODO()
  - propagate HTTP traceID/spanID through TaskQueueMessage into RabbitMQ
    worker, linking HTTP request → publish → execution on the same traceID
  - fix GORM logger null traceID by binding ctx to AutoMigrate and queries
    via db.WithContext(ctx)
  - thread ctx through handler factory to fix null traceID in startup logs
  - replace per-request RabbitMQ producer with channel-based
    PushTaskToRabbitMQ goroutine; restrict Swagger to non-production
2026-04-23 16:48:32 +08:00
douxu 898beaeec4 optimize struct of rabbitmq event 2026-03-02 17:00:09 +08:00
douxu a31bd6f395 add component attribute group update api and optimzie diagram hash set params 2026-01-05 17:20:41 +08:00
douxu fcf4ef3f7d fix bug of token4-token7 type attribute recommend api 2025-12-31 16:52:40 +08:00
douxu e74bedd47f fix bug of token4-token7 type recommend api 2025-12-31 16:24:27 +08:00
douxu 36e196bedd add nspath filter of recommend api 2025-12-30 16:35:29 +08:00
douxu 941d521328 fix bug of token6 all search result return case 2025-12-29 15:58:59 +08:00
douxu 7969861746 optimize func of cleanup recommend redis cache 2025-12-26 17:10:22 +08:00
douxu 8e4bdfd0e9 add fullpath completion of component attribute group recommend 2025-12-26 12:00:00 +08:00
douxu 42751c1020 optimize the logic for loading the cache of measurement nodes for traversing components 2025-12-25 17:17:20 +08:00
douxu 51f65500f3 add func of init component measurement recommend 2025-12-24 16:55:55 +08:00
douxu 6e16a9a39a fix bug of measurement recommend injection func 2025-12-24 09:06:42 +08:00
douxu c29f58f388 fix bug of token4-token7 model config complete op 2025-12-23 16:44:31 +08:00
douxu 8313b16dfe fix bug of measurement recommend of token6 complete op and token7 hierarchy recommend 2025-12-23 15:09:33 +08:00
douxu f45f10507b fix bug of measurement recommend of token6 complete op and token7 hierarchy recommend 2025-12-23 14:52:39 +08:00
douxu 41e2998739 optimize deploy doc and optimize TraverseAttributeGroupTables func 2025-12-22 17:38:15 +08:00
douxu c16680d4c2 fix bug of t4-t7 model combine prefix string func 2025-12-22 10:45:47 +08:00
douxu 9499e579b3 optimize code of sql struct and measurement node recommend api 2025-12-19 17:33:12 +08:00
douxu 70bcb00062 add code of component attribute group store 2025-12-18 17:50:43 +08:00
douxu df77f80475 add func of component param group recommend func 2025-12-17 17:10:47 +08:00
douxu 252699cb77 fix bug of measurement api and add func of traverse attribute group table 2025-12-16 16:34:19 +08:00
douxu 0add3cf6db feat:implement search support for abbreviated token ranges (e.g., token4-token7) 2025-12-15 16:49:38 +08:00
douxu c68cc9436a fix bug of measurement recommend api 2025-12-12 14:19:50 +08:00
douxu 3f70be0d1c fix bug of new version of measurement recommend api 2025-12-06 18:32:00 +08:00
douxu 46e72ce588 optimize redis test data lua shell 2025-12-04 17:26:35 +08:00
douxu b99c03296a optimize measurement recommend api 2025-12-03 16:55:14 +08:00
douxu b6e47177fb debugging API using single measurement point subscription case 2025-11-25 16:13:55 +08:00
douxu 8d6efe8bb1 optimize real time data pull api 2025-11-10 17:32:18 +08:00
douxu b75358e676 optimize first create monitor config func of real time data query api 2025-11-05 18:20:54 +08:00
douxu f5ea909120 optimize real time data query api 2025-11-04 17:12:15 +08:00
douxu 54128bedac fix bug of measurement recommend api 2025-10-20 15:06:23 +08:00
douxu f0a66263a3 optimize measurement recommend api 2025-10-16 17:18:57 +08:00
douxu 62e897190d optimize code of measurement recommend and logger output 2025-10-15 17:08:32 +08:00
douxu 5d02ca9fca add measurement recommend api 2025-09-29 16:37:38 +08:00
douxu 453e6f9851 add GetLongestCommonPrefixLength func 2025-09-27 15:56:46 +08:00
douxu 0d7890f6aa optimize code of RedissearchRecommend func 2025-09-26 16:47:40 +08:00