Restrict graph to tracked commits
This commit is contained in:
parent
91e4883137
commit
4d222e971c
5 changed files with 25 additions and 17 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"db_name": "SQLite",
|
"db_name": "SQLite",
|
||||||
"query": "WITH measurements AS ( SELECT hash, value, MAX(start) FROM runs JOIN run_measurements USING (id) WHERE metric = ? GROUP BY hash ) SELECT value FROM commits LEFT JOIN measurements USING (hash) ORDER BY hash ASC ",
|
"query": "WITH measurements AS ( SELECT hash, value, MAX(start) FROM runs JOIN run_measurements USING (id) WHERE metric = ? GROUP BY hash ) SELECT value FROM commits LEFT JOIN measurements USING (hash) WHERE reachable = 2 ORDER BY hash ASC ",
|
||||||
"describe": {
|
"describe": {
|
||||||
"columns": [
|
"columns": [
|
||||||
{
|
{
|
||||||
|
|
@ -16,5 +16,5 @@
|
||||||
true
|
true
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"hash": "c202b6c8e83d2535301e0633404b83a7a7b4b105338833223dd5ab0ebdecfdfd"
|
"hash": "0d2711c13a7835dd6a6708c2dc81ca15ab3a58a8553a5837351ec63265edb5c2"
|
||||||
}
|
}
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"db_name": "SQLite",
|
"db_name": "SQLite",
|
||||||
"query": "SELECT hash, committer_date AS \"time: OffsetDateTime\" FROM commits ORDER BY hash ASC ",
|
"query": "SELECT hash, committer_date AS \"time: OffsetDateTime\" FROM commits WHERE reachable = 2 ORDER BY hash ASC ",
|
||||||
"describe": {
|
"describe": {
|
||||||
"columns": [
|
"columns": [
|
||||||
{
|
{
|
||||||
|
|
@ -22,5 +22,5 @@
|
||||||
false
|
false
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"hash": "3227b67648549c213c6ad34c78842a8d8120d3202f002d293e674cac994adedc"
|
"hash": "0dc1d000038b42bbbcfe16a11cb8c89a86ba9bb71368a413eb90593f5da166e0"
|
||||||
}
|
}
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"db_name": "SQLite",
|
"db_name": "SQLite",
|
||||||
"query": "SELECT parent, child FROM commit_links ORDER BY parent ASC, child ASC ",
|
"query": "SELECT parent, child FROM commit_links JOIN commits ON hash = parent WHERE reachable = 2 ORDER BY parent ASC, child ASC ",
|
||||||
"describe": {
|
"describe": {
|
||||||
"columns": [
|
"columns": [
|
||||||
{
|
{
|
||||||
|
|
@ -22,5 +22,5 @@
|
||||||
false
|
false
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"hash": "eecd95c794db0640d2de01dc644af7e2c6e4ab357710d6a1ee374cad106c166e"
|
"hash": "4f3c635a7026015f95d20823a25a00870a19f9336c3566b1daeb639f81cb2154"
|
||||||
}
|
}
|
||||||
|
|
@ -170,6 +170,7 @@ pub async fn get_graph_data(
|
||||||
hash, \
|
hash, \
|
||||||
committer_date AS \"time: OffsetDateTime\" \
|
committer_date AS \"time: OffsetDateTime\" \
|
||||||
FROM commits \
|
FROM commits \
|
||||||
|
WHERE reachable = 2 \
|
||||||
ORDER BY hash ASC \
|
ORDER BY hash ASC \
|
||||||
"
|
"
|
||||||
)
|
)
|
||||||
|
|
@ -185,6 +186,8 @@ pub async fn get_graph_data(
|
||||||
"\
|
"\
|
||||||
SELECT parent, child \
|
SELECT parent, child \
|
||||||
FROM commit_links \
|
FROM commit_links \
|
||||||
|
JOIN commits ON hash = parent \
|
||||||
|
WHERE reachable = 2 \
|
||||||
ORDER BY parent ASC, child ASC \
|
ORDER BY parent ASC, child ASC \
|
||||||
"
|
"
|
||||||
)
|
)
|
||||||
|
|
@ -205,9 +208,11 @@ pub async fn get_graph_data(
|
||||||
|
|
||||||
let mut parents = HashMap::<usize, Vec<usize>>::new();
|
let mut parents = HashMap::<usize, Vec<usize>>::new();
|
||||||
for (parent, child) in &parent_child_pairs {
|
for (parent, child) in &parent_child_pairs {
|
||||||
let parent_idx = sorted_hash_indices[parent];
|
if let Some(parent_idx) = sorted_hash_indices.get(parent) {
|
||||||
let child_idx = sorted_hash_indices[child];
|
if let Some(child_idx) = sorted_hash_indices.get(child) {
|
||||||
parents.entry(parent_idx).or_default().push(child_idx);
|
parents.entry(*parent_idx).or_default().push(*child_idx);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Collect times
|
// Collect times
|
||||||
|
|
@ -239,6 +244,7 @@ pub async fn get_graph_data(
|
||||||
SELECT value \
|
SELECT value \
|
||||||
FROM commits \
|
FROM commits \
|
||||||
LEFT JOIN measurements USING (hash) \
|
LEFT JOIN measurements USING (hash) \
|
||||||
|
WHERE reachable = 2 \
|
||||||
ORDER BY hash ASC \
|
ORDER BY hash ASC \
|
||||||
",
|
",
|
||||||
metric,
|
metric,
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,7 @@ pub fn sort_topologically(
|
||||||
.map(|hash| (hash.clone(), HashSet::<String>::new()))
|
.map(|hash| (hash.clone(), HashSet::<String>::new()))
|
||||||
.collect::<HashMap<_, _>>();
|
.collect::<HashMap<_, _>>();
|
||||||
for (parent, child) in parent_child_pairs {
|
for (parent, child) in parent_child_pairs {
|
||||||
|
if parent_child_map.contains_key(parent) && parent_child_map.contains_key(child) {
|
||||||
parent_child_map
|
parent_child_map
|
||||||
.get_mut(parent)
|
.get_mut(parent)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
|
|
@ -74,6 +75,7 @@ pub fn sort_topologically(
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.insert(parent.clone());
|
.insert(parent.clone());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Initialize parentless stack using commit list, in reverse order so that
|
// Initialize parentless stack using commit list, in reverse order so that
|
||||||
// the order is right when popping.
|
// the order is right when popping.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue