u
[feisty_meow.git] / scripts / notes / info_overload_report.sh
1
2 # these metrics are how bogged down we are in to-do type items.
3
4 REPORT_FILE="$HOME/cloud/overload_history.txt"
5
6 # given a path, this will find how many items are under it, ignoring svn and git files.
7 function calculate_depth()
8 {
9   local dir="$1"; shift
10   find "$dir" -type f -exec echo \"{}\" ';' | grep -v "\.svn" | grep -v "\.git" | wc -l | tr -d ' '
11 }
12
13 ##############
14
15 # notes are individual files of tasks, usually, although some are combined.
16 note_depth=$(calculate_depth ~/cloud/grunty_notes)
17
18 # unsorted files haven't been categorized yet.
19 unsorted_depth=$(calculate_depth ~/cloud/unsorted)
20
21 # source examples need to be sucked into other places, other codebases.  they are not
22 # supposed to pile up here.
23 source_example_depth=$(calculate_depth ~/cloud/example_source)
24
25 # the list files are web documents with to-do lists.  individual items are marked with <li>.
26 item_depth=$(find ~/cloud/grunty_notes/ -type f -iname "*.html" -exec grep "<li" "{}" ';' | wc -l | tr -d ' ')
27
28 # scan across all appropriately named folders in our folders that live in the "cloud".
29 cloud_project_depth=0
30 for i in ~/cloud/*project* ~/cloud/*research*; do
31   temp_depth=$(calculate_depth $i)
32   cloud_project_depth=$(($cloud_project_depth + $temp_depth))
33 done
34
35 # also snag the files labelled as trivia, since they're still to-dos...
36 cloud_trivia_depth=0
37 for i in ~/cloud/*trivia*; do
38   temp_depth=$(calculate_depth $i)
39   cloud_trivia_depth=$(($cloud_trivia_depth + $temp_depth))
40 done
41
42 # and then count up the things that we think will be cleaned soon, but one thing we have learned
43 # is that things that are intended are not always followed up on right away.  this catches us
44 # being too hopeful and makes sure nothing seems to be getting done that's lagging.
45 cloud_active_depth=0
46 for i in ~/cloud/*active*; do
47   temp_depth=$(calculate_depth $i)
48   cloud_active_depth=$(($cloud_active_depth + $temp_depth))
49 done
50
51 #hmmm: the find and add thing is starting to look like a useful function.
52
53 ##############
54
55 total_overload=$(($note_depth + $item_depth + $unsorted_depth + $source_example_depth + $cloud_project_depth + $cloud_trivia_depth + $cloud_active_depth))
56
57 report="\
58 \n\
59 Current information overload consists of:\n\
60 \n\
61   $note_depth\tgrunty notes\n\
62   $item_depth\tto-do list items\n\
63   $unsorted_depth\tunsorted files\n\
64   $source_example_depth\tsource examples\n\
65   $cloud_project_depth\tproject files\n\
66   $cloud_trivia_depth\ttrivial notes\n\
67   $cloud_active_depth\tactive items\n\
68   -------\n\
69   $total_overload\ttotal items\n\
70 \n\
71 Gathered On: $(date)\n\
72 \n\
73 ##############"
74
75 echo -e "$report" | tee -a "$REPORT_FILE"
76