Giter Site home page Giter Site logo

opensodaexcitingt2's Introduction

WengSy's GitHub stats

opensodaexcitingt2's People

Contributors

dependabot[bot] avatar lh123cha avatar qkgoalkeeper avatar wengsy150943 avatar yinzheng-sun avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

opensodaexcitingt2's Issues

数据接口需求

大家在这个issue里向上游要求接口吧。

应该包含:
需求函数的函数签名,返回的数据接口类型,哪些内容可以是nil,如果是string之类的不明确编码需要约定格式。
然后直接@对应的上游。

[docs] 文档修改

请大家确认一下现在的文档,看看有没有什么地方是不对的或者要修改的。

新功能讨论

除了标准要求的功能以外,这个CLI工具还可以提供什么功能?

下面是标准要求的功能:

  • 查询特定仓库特定指标上的数据,并支持本地导出功能
  • 查询特定仓库特定自然月上在特定指标上的数据,并支持本地导出功能
  • 查询特定仓库特定自然月份上的整体报告,并支持本地导出功能

【进度确认】检查是否有遗漏的开发任务,以及当前任务的预期完成时间

想和大家确认一下进度,看看有没有遗漏的。麻烦大家看看有没有哪些部分还没写,或者现在在写的部分预期完成时间。

代码:

  • 单点查询
    • 解析parse
      • 基于用户请求【#50 完成后一天内】
    • 读取
      • 基于用户请求【#50
    • 输出print
      • 基于用户请求【#50 完成后一天内】
  • 比较查询
    • 解析
      • 基于用户请求【#50 完成后一天内】
  • 文件下载
    • #53
    • 单个月份下载
    • 单个metric下载
    • 基于用户请求
  • 批量分析
    • 解析 【#44 完成后一天内】
    • 读取 【#44
  • 日志查询
    • 解析 【#52
    • 输出print 【#52

设计文档讨论

目前设计文档的主体已经基本完工,请大家阅读一下内容,然后提一下修改的意见。

请大家先回复一下是否完成了自己部分的内容,然后提一下对其他已完成部分的建议。请大家在周日中午前处理完对应的意见,我会在周日下午导出md文件并上传到仓库中。

测试问题讨论

基本功能都实现了,用真实数据测试时如果有bug请在此讨论

[feat]:用户信息后端返回数据

GetCertainUser接口返回UserInfo结构体

Username Dates Data
string []string map[string](map[string]interface{})

Data字段和repoinfo的Data字段一样
utils/parseusermetric中可以Parseuser将User中的Data解析为

Openrank Activity Developernetwork Reponetwork
map[string](float64) map[string](float64) map[string]([]interface{}) map[string]([]interface{})
这里[]interface{}其实还要再转换一下成[]interface{},但go不支持转换成[][]interface{} 同Developernetwork

cobra调用downloadservice的改动说明

image

由于golang接口无法支持参数数量不同的情况,因此downloadservice将不再采用interface这一用法

image

新的调用方法如图所示,直接调用即可,cobra那边要注意不同downloadservice的参数不同

@wengsy150943

[Feature] batch

确定一下batch的开发目标:读csv文件,将读出来的数据转换成repoinfolist,然后经过filter/sort,将结果再写回文件?
@wengsy150943 @lh123cha

[HELP] issue_response_time中level的物理意义是什么

以issue_response_time为例:{"avg":{"2020-08":149.29,"2020-09":1.5,"2020-10":0,"2020-11":114.11,"2020-12":74.67,"2021-01":294.67,"2021-02":0,"2021-03":3,"2021-04":55.92,"2021-05":9.5,"2021-06":405.2,"2021-07":55.25,"2021-08":155.6,"2021-11":1,"2021-12":161.36,"2022-01":84.12,"2022-02":0.6,"2022-03":76.47,"2022-04":1,"2022-05":34.5,"2022-06":40,"2022-07":0.33,"2022-08":0.33,"2022-09":24.78,"2022-10":2.12,"2022-11":55.96,"2022-12":53.17,"2023-01":27.5,"2023-02":68.93,"2023-03":30.12,"2023-04":8.88,"2023-05":8.45,"2023-06":6.12},"levels":{"2020-08":[6,0,0,1],"2020-09":[5,0,1,0],"2020-10":[3,0,0,0],"2020-11":[3,1,1,4],"2020-12":[5,0,0,1],"2021-01":[2,0,0,1],"2021-02":[3,0,0,0],"2021-03":[2,1,0,0],"2021-04":[9,1,1,2],"2021-05":[2,0,0,2],"2021-06":[8,1,0,26],"2021-07":[0,1,0,3],"2021-08":[1,0,0,4],"2021-11":[3,0,0,0],"2021-12":[5,0,2,4],"2022-01":[3,0,1,4],"2022-02":[5,0,0,0],"2022-03":[16,0,0,3],"2022-04":[4,1,0,0],"2022-05":[4,1,0,1],"2022-06":[13,0,0,2],"2022-07":[9,0,0,0],"2022-08":[3,0,0,0],"2022-09":[6,1,0,2],"2022-10":[14,1,0,1],"2022-11":[15,2,1,8],"2022-12":[7,0,0,5],"2023-01":[8,2,0,2],"2023-02":[6,1,0,7],"2023-03":[4,1,1,2],"2023-04":[8,5,2,2],"2023-05":[6,1,2,2],"2023-06":[3,2,2,1]}}
月份对应的metric value为 map哈希表{"avg":149.29, "levels":[6,0,0,1]...}

如题,对于issue_response_time的均值以及n分位数我采用了多折线图来表示,差个level

[Feat]log中缓存数据的结构

sqlite中存储的查询结果数据格式:

Uid CreatedAt Reponame Repourl Data
int time string string map

sqlite中存储的历史查询数据格式:

Uid CreatedAt Log
int time string

更新downloadService.SetData接口

由于查询模块返回为map,downloadService.setData不再与数据类型一致,可能需要修改。

或由交互模块转换为string再调用setData?哪种方案更有利于输出模块的实现? @qkgoalkeeper

[bug]发现数据仍不满足下载要求,对于downloadservice来说month应该是范围而不是特定月份

image

有大问题,repoinfoservice所有函数都需要metric作为参数,download在用户角度还需要可以实现查询一个repo迄今为止的全部metric的数据即全部数据(能在html中画几十张图那种),downloadservice中的图横坐标皆为dates:[2020-01,2020-02...],只传一个月根本画不出图就是个点

建议特定月份查询只适用于show没必要download,即使download了其内容也和show无区别

因此需要从getResult开始修改添加一个获取全部数据,month和metrics皆为空时获取全部数据,repoinfoservice实现相应函数

image

比如类似这个写一个全部月份的获取getrepoinfo(repo string)

(P.S.这个问题是我在测试downloadservicetest时发现的,发现没有api能画一系列图)

<img width="973" alt="image" src="https://github.com/wengsy150943/OpenSODAExcitingT2/assets/57783174/b86e1b56-c420-4eb0-8a21-3980cdf16934">

          <img width="973" alt="image" src="https://github.com/wengsy150943/OpenSODAExcitingT2/assets/57783174/b86e1b56-c420-4eb0-8a21-3980cdf16934">

repoinfo 的 仓库名 RepoName似乎在用户只填写month不填写metric时会丢失用户信息,
例如go run ./main.go download -p all -r X-lab2017/open-digger
此时的reponame为X-lab2017/open-digger

go run ./main.go download -p metric1 -r X-lab2017/open-digger -m active_dates_and_times
此时的reponame为open-digger,这导致了仓库名不对

请检查repoinfoservice获取reponame的过程

Originally posted by @qkgoalkeeper in #78 (comment)

[Feat]以用户名为参数的查询获得的指标的结构

返回一个Userinfo
image
其中,Data中包含四种指标数据

openrank activity developernetwork reponetwork
map[string]float map[string]float map[string]([]interface{}) map[string]([]interface{})
用户在每个月份的openrank值 用户在每个月份的activity值 用户与其他用户的网络关系 用户与仓库的网络关系
其中包含"nodes":[["username1",17.123],...]
"edges":[["username1","username2","45.4564"]]
同developernetwork

注意opendigger上游api中日期格式的变化,需对现有数据获取模块进行更新

问题:
发现11月开始,opendigger的api返回的日期不止有“2023-11”这样的“xxxx-xx”结构,其新添加了“2023”以及“2023Q1”这样的年度总结和季度总结,目前的代码中日期统一以“xxxx-xx”进行解析,因此现有的download功能及整体查询功能会受到影响,运行时会有日期错误的提示

解决方案:
获取RepoInfo的时候将不符合“xxxx-xx”的数据进行过滤,需要过滤Dates和Data中的日期数据
RepoInfo的位置为getrepoinfoservice.go line 16,各个获取RepoInfo的函数也在getrepoinfoservice.go中
image

[docs] 测试文档撰写

根据测试结果可写个测试文档在doc/test.md中,测试格式大致如下:

测试1:(测试的功能)
示例输入:(命令行语句)
测试结果:(一张测试的图片)

[HELP] how to plot metrics like ‘’issue_response_time‘’ with e-chart in the template

issue_response_time:{"avg":{"2020-08":149.29,"2020-09":1.5,"2020-10":0,"2020-11":114.11,"2020-12":74.67,"2021-01":294.67,"2021-02":0,"2021-03":3,"2021-04":55.92,"2021-05":9.5,"2021-06":405.2,"2021-07":55.25,"2021-08":155.6,"2021-11":1,"2021-12":161.36,"2022-01":84.12,"2022-02":0.6,"2022-03":76.47,"2022-04":1,"2022-05":34.5,"2022-06":40,"2022-07":0.33,"2022-08":0.33,"2022-09":24.78,"2022-10":2.12,"2022-11":55.96,"2022-12":53.17,"2023-01":27.5,"2023-02":68.93,"2023-03":30.12,"2023-04":8.88,"2023-05":8.45,"2023-06":6.12},"levels":{"2020-08":[6,0,0,1],"2020-09":[5,0,1,0],"2020-10":[3,0,0,0],"2020-11":[3,1,1,4],"2020-12":[5,0,0,1],"2021-01":[2,0,0,1],"2021-02":[3,0,0,0],"2021-03":[2,1,0,0],"2021-04":[9,1,1,2],"2021-05":[2,0,0,2],"2021-06":[8,1,0,26],"2021-07":[0,1,0,3],"2021-08":[1,0,0,4],"2021-11":[3,0,0,0],"2021-12":[5,0,2,4],"2022-01":[3,0,1,4],"2022-02":[5,0,0,0],"2022-03":[16,0,0,3],"2022-04":[4,1,0,0],"2022-05":[4,1,0,1],"2022-06":[13,0,0,2],"2022-07":[9,0,0,0],"2022-08":[3,0,0,0],"2022-09":[6,1,0,2],"2022-10":[14,1,0,1],"2022-11":[15,2,1,8],"2022-12":[7,0,0,5],"2023-01":[8,2,0,2],"2023-02":[6,1,0,7],"2023-03":[4,1,1,2],"2023-04":[8,5,2,2],"2023-05":[6,1,2,2],"2023-06":[3,2,2,1]}}
月份对应的metric value为 map哈希表{"avg":149.29, "levels":[6,0,0,1]...}

大部分特殊的metric都有echart实现的思路,还剩这种value为map[string]interface{}要怎么画图,avg倒是可以画个柱状图,特别这个levels是每月一个list是什么意思,如何展示

[Bug] Getrepoinfoservice.go中的函数

GetCertainMonth函数目前查询某些metric时存在bug,因为存在hash表里面又嵌套了hash表的情况,所以应该DFS所有hashtable,例如下面这种情况,如果只是简单遍历第一层的hashtable,最后会返回空值。此外,还有一些metric的结果是列表而并不是数值,应该做单独处理。

例如:查找
map[avg:map[2020-08:0.58 2020-09:0.09 2020-10:0.33 2020-11:0 2020-12:0.83 2021-01:0.18 2021-03:0.5 2021-04:0.47 2021-05:151.6 2021-06:1.43 2021-07:1 2021-11:0.33 2021-12:13 2022-01:2 2022-02:0 2022-03:0.07 2022-04:0.56 2022-05:52.57 2022-06:18.24 2022-07:22.07 2022-08:0.42 2022-09:1.2 2022-10:0.82 2022-11:1.11 2022-12:0.82 2023-01:51.24 2023-02:29.52 2023-03:0.67 2023-04:2 2023-05:1.92] levels:map[2020-08:[11 1 0 0] 2020-09:[11 0 0 0] 2020-10:[3 0 0 0] 2020-11:[4 0 0 0] 2020-12:[22 0 1 0] 2021-01:[17 0 0 0] 2021-03:[2 0 0 0] 2021-04:[14 1 0 0] 2021-05:[4 0 0 1] 2021-06:[6 0 1 0] 2021-07:[1 0 0 0] 2021-11:[3 0 0 0] 2021-12:[1 1 1 1] 2022-01:[3 0 1 0] 2022-02:[4 0 0 0] 2022-03:[28 0 0 0] 2022-04:[8 1 0 0] 2022-05:[6 0 0 1] 2022-06:[19 0 0 2] 2022-07:[14 0 0 1] 2022-08:[11 1 0 0] 2022-09:[8 2 0 0] 2022-10:[11 0 0 0] 2022-11:[17 2 0 0] 2022-12:[16 1 0 0] 2023-01:[18 0 0 11] 2023-02:[19 1 0 7] 2023-03:[8 1 0 0] 2023-04:[10 2 0 0] 2023-05:[10 2 1 0]] quantile_0:map[2020-08:0 2020-09:0 2020-10:0 2020-11:0 2020-12:0 2021-01:0 2021-03:0 2021-04:0 2021-05:0 2021-06:0 2021-07:1 2021-11:0 2021-12:0 2022-01:0 2022-02:0 2022-03:0 2022-04:0 2022-05:0 2022-06:0 2022-07:0 2022-08:0 2022-09:0 2022-10:0 2022-11:0 2022-12:0 2023-01:0 2023-02:0 2023-03:0 2023-04:0 2023-05:0] quantile_1:map[2020-08:0 2020-09:0 2020-10:0 2020-11:0 2020-12:0 2021-01:0 2021-03:0.25 2021-04:0 2021-05:0 2021-06:0 2021-07:1 2021-11:0 2021-12:3.75 2022-01:0 2022-02:0 2022-03:0 2022-04:0 2022-05:0 2022-06:0 2022-07:0 2022-08:0 2022-09:0 2022-10:0 2022-11:0 2022-12:0 2023-01:0 2023-02:0 2023-03:0 2023-04:1 2023-05:0] quantile_2:map[2020-08:0 2020-09:0 2020-10:0 2020-11:0 2020-12:0 2021-01:0 2021-03:0.5 2021-04:0 2021-05:0 2021-06:0 2021-07:1 2021-11:0 2021-12:6.5 2022-01:0 2022-02:0 2022-03:0 2022-04:0 2022-05:0 2022-06:0 2022-07:0 2022-08:0 2022-09:0 2022-10:0 2022-11:0 2022-12:0 2023-01:1 2023-02:0 2023-03:0 2023-04:2 2023-05:1] quantile_3:map[2020-08:1 2020-09:0 2020-10:0.5 2020-11:0 2020-12:0.5 2021-01:0 2021-03:0.75 2021-04:0 2021-05:3 2021-06:1 2021-07:1 2021-11:0.5 2021-12:15.75 2022-01:2 2022-02:0 2022-03:0 2022-04:0 2022-05:1 2022-06:1 2022-07:0 2022-08:0 2022-09:0 2022-10:1.5 2022-11:1 2022-12:1 2023-01:126 2023-02:51.5 2023-03:1 2023-04:3 2023-05:3] quantile_4:map[2020-08:4 2020-09:1 2020-10:1 2020-11:0 2020-12:12 2021-01:1 2021-03:1 2021-04:5 2021-05:755 2021-06:8 2021-07:1 2021-11:1 2021-12:39 2022-01:8 2022-02:0 2022-03:1 2022-04:5 2022-05:366 2022-06:355 2022-07:329 2022-08:4 2022-09:7 2022-10:3 2022-11:7 2022-12:4 2023-01:148 2023-02:120 2023-03:4 2023-04:4 2023-05:8]]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.