dosubot[bot] commented on issue #8664: URL: https://github.com/apache/incubator-devlake/issues/8664#issuecomment-3665052390
<!-- Greeting --> Hi @ansri-abodey! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the incubator-devlake team. <!-- Answer --> Yes, the established convention in DevLake plugins—especially with pydevlake—is to map each distinct data stream to its own dedicated table for clarity and normalization. For your Copilot plugin, it's recommended to create a new table for enterprise metrics (e.g., `copilot_enterprise_daily`) and another for user metrics (e.g., `copilot_user_daily`). This approach is used in plugins like `q_dev`, which maps user metrics to a table named `_tool_q_dev_user_data` with fields for user ID, date, display name, and various metric counts, supporting granular analysis and efficient queries [[example](https://github.com/apache/incubator-devlake/blob/main/backend/plugins/q_dev/models/user_data.go)]. In pydevlake, table naming typically follows the pattern `_tool_{plugin_name}_{plural_entity}` [[reference](https://github.com/apache/incubator-devlake/blob/main/backend/python/pydevlake/pydevlake/model.py)]. For best results, include primary keys and indexes on fields like `connection_id`, `user_id`, and `date` to facilitate joins and cross-metric analysis with DORA metrics and other DevLake data [[reference](https://github.com/apache/incubator-devlake/blob/main/backend/plugins/q_dev/models/user_data.go)]. No conflicting guidance or alternative conventions were found in recent issues or threads. This modeling approach will make your plugin consistent with current DevLake practices and support robust analytics. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/8bb355c7-7ebe-44ff-b0b8-936ebbce114d?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/8bb355c7-7ebe-44ff-b0b8-936ebbce114d?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/8bb355c7-7ebe-44ff-b0b8-936ebbce114d?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/8bb355c7-7ebe-44ff-b0b8-936ebbce114d?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/8bb355c7-7ebe-44ff-b0b8-936ebbce114d?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/8bb355c7-7ebe-44ff-b0b8-936ebbce114d?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/8bb355c7-7ebe-44ff-b0b8-936ebbce114d?feedback_type=other)</sup> [](https://app.dosu.dev/b4e8e847-d479-4541-83a8-d88d83fea5c9/ask?utm_source=github) [](https://cursor.com/link/prompt?text=Yes%2C%20the%20established%20convention%20in%20DevLake%20plugins%E2%80%94especially%20with%20pydevlake%E2%80%94is%20to%20map%20each%20distinct%20data%20stream%20to%20its%20own%20dedicated%20table%20for%20clarity%20and%20normalization.%20For%20your%20Copilot%20plugin%2C%20it%27s%20recommended%20to%20create%20a%20new%20table%20for%20enterprise%20metrics%20%28e.g.%2C%20%60copilot_enterprise_daily%60%29%20and%20another%20for%20user%20metrics%20%28e.g.%2C%20%60copilot_user_daily%60%29.%20This%20approach%20is%20used%20in%20plugins%20like%20%60q_dev%60%2C%20which%20maps%20user%20metrics%20to%20a%20table%20named%20%60_tool_q_dev_user_data%60%20with%20fields%20for%20user%20ID%2C%20date%2C%20display%20name%2C%20and%20various%20metric%20counts%2C%20supporting %20granular%20analysis%20and%20efficient%20queries%20%5B%5Bexample%5D%28https%3A//github.com/apache/incubator-devlake/blob/main/backend/plugins/q_dev/models/user_data.go%29%5D.%0A%0AIn%20pydevlake%2C%20table%20naming%20typically%20follows%20the%20pattern%20%60_tool_%7Bplugin_name%7D_%7Bplural_entity%7D%60%20%5B%5Breference%5D%28https%3A//github.com/apache/incubator-devlake/blob/main/backend/python/pydevlake/pydevlake/model.py%29%5D.%20For%20best%20results%2C%20include%20primary%20keys%20and%20indexes%20on%20fields%20like%20%60connection_id%60%2C%20%60user_id%60%2C%20and%20%60date%60%20to%20facilitate%20joins%20and%20cross-metric%20analysis%20with%20DORA%20metrics%20and%20other%20DevLake%20data%20%5B%5Breference%5D%28https%3A//github.com/apache/incubator-devlake/blob/main/backend/plugins/q_dev/models/user_data.go%29%5D.%0A%0ANo%20conflicting%20guidance%20or%20alternative%20conventions%20were%20found%20in%20recent%20issues%20or%20threads.%20This%20modeling%20approach%20will%20make%20y our%20plugin%20consistent%20with%20current%20DevLake%20practices%20and%20support%20robust%20analytics.) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/incubator-devlake/issues/8664) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
