@@ -1691,47 +1691,131 @@ int cmd_survey(int argc, const char **argv, const char *prefix, struct repositor
16911691}
16921692
16931693/*
1694- * NEEDSWORK: The following is a bit of a laundry list of things
1695- * that I'd like to add.
1694+ * NEEDSWORK: So far, I only have iteration on the requested set of
1695+ * refs and treewalk/reachable objects on that set of refs. The
1696+ * following is a bit of a laundry list of things that I'd like to
1697+ * add.
16961698 *
16971699 * [] Dump stats on all of the packfiles. The number and size of each.
1698- * Whether each is in the .git directory or in an alternate. The state
1699- * of the IDX or MIDX files and etc. Delta chain stats. All of this
1700- * data is relative to the "lived-in" state of the repository. Stuff
1701- * that may change after a GC or repack.
1700+ * Whether each is in the .git directory or in an alternate. The
1701+ * state of the IDX or MIDX files and etc. Delta chain stats. All
1702+ * of this data is relative to the "lived-in" state of the
1703+ * repository. Stuff that may change after a GC or repack.
1704+ *
1705+ * [] Clone and Index stats. partial, shallow, sparse-checkout,
1706+ * sparse-index, etc. Hydration stats.
17021707 *
17031708 * [] Dump stats on each remote. When we fetch from a remote the size
1704- * of the response is related to the set of haves on the server. You
1705- * can see this in `GIT_TRACE_CURL=1 git fetch`. We get a `ls-refs`
1706- * payload that lists all of the branches and tags on the server, so
1707- * at a minimum the RefName and SHA for each. But for annotated tags
1708- * we also get the peeled SHA. The size of this overhead on every
1709- * fetch is proporational to the size of the `git ls-remote` response
1710- * (roughly, although the latter repeats the RefName of the peeled
1711- * tag). If, for example, you have 500K refs on a remote, you're
1712- * going to have a long "haves" message, so every fetch will be slow
1713- * just because of that overhead (not counting new objects to be
1714- * downloaded).
1709+ * of the response is related to the set of haves on the server.
1710+ * You can see this in `GIT_TRACE_CURL=1 git fetch`. We get a
1711+ * `ls-refs` payload that lists all of the branches and tags on the
1712+ * server, so at a minimum the RefName and SHA for each. But for
1713+ * annotated tags we also get the peeled SHA. The size of this
1714+ * overhead on every fetch is proporational to the size of the `git
1715+ * ls-remote` response (roughly, although the latter repeats the
1716+ * RefName of the peeled tag). If, for example, you have 500K refs
1717+ * on a remote, you're going to have a long "haves" message, so
1718+ * every fetch will be slow just because of that overhead (not
1719+ * counting new objects to be downloaded).
17151720 *
1716- * Note that the local set of tags in "refs/tags/" is a union over all
1717- * remotes. However, since most people only have one remote, we can
1718- * probaly estimate the overhead value directly from the size of the
1719- * set of "refs/tags/" that we visited while building the `ref_info`
1720- * and `ref_array` and not need to ask the remote.
1721+ * Note that the local set of tags in "refs/tags/" is a union over
1722+ * all remotes. However, since most people only have one remote,
1723+ * we can probaly estimate the overhead value directly from the
1724+ * size of the set of "refs/tags/" that we visited while building
1725+ * the `ref_info` and `ref_array` and not need to ask the remote.
17211726 *
17221727 * [] Dump info on the complexity of the DAG. Criss-cross merges.
1723- * The number of edges that must be touched to compute merge bases.
1724- * Edge length. The number of parallel lanes in the history that must
1725- * be navigated to get to the merge base. What affects the cost of
1726- * the Ahead/Behind computation? How often do criss-crosses occur and
1727- * do they cause various operations to slow down?
1728+ * The number of edges that must be touched to compute merge bases.
1729+ * Edge length. The number of parallel lanes in the history that
1730+ * must be navigated to get to the merge base. What affects the
1731+ * cost of the Ahead/Behind computation? How often do
1732+ * criss-crosses occur and do they cause various operations to slow
1733+ * down?
17281734 *
17291735 * [] If there are primary branches (like "main" or "master") are they
1730- * always on the left side of merges? Does the graph have a clean
1731- * left edge? Or are there normal and "backwards" merges? Do these
1732- * cause problems at scale?
1736+ * always on the left side of merges? Does the graph have a clean
1737+ * left edge? Or are there normal and "backwards" merges? Do
1738+ * these cause problems at scale?
17331739 *
17341740 * [] If we have a hierarchy of FI/RI branches like "L1", "L2, ...,
1735- * can we learn anything about the shape of the repo around these FI
1736- * and RI integrations?
1741+ * can we learn anything about the shape of the repo around these
1742+ * FI and RI integrations?
1743+ *
1744+ * [] Do we need a no-PII flag to omit pathnames or branch/tag names
1745+ * in the various histograms? (This would turn off --name-rev
1746+ * too.)
1747+ *
1748+ * [] I have so far avoided adding opinions about individual fields
1749+ * (such as the way `git-sizer` prints a row of stars or bangs in
1750+ * the last column).
1751+ *
1752+ * I'm wondering if that is a job of this executable or if it
1753+ * should be done in a post-processing step using the JSON output.
1754+ *
1755+ * My problem with the `git-sizer` approach is that it doesn't give
1756+ * the (casual) user any information on why it has stars or bangs.
1757+ * And there isn't a good way to print detailed information in the
1758+ * ASCII-art tables that would be easy to understand.
1759+ *
1760+ * [] For example, a large number of refs does not define a cliff.
1761+ * Performance will drop off (linearly, quadratically, ... ??).
1762+ * The tool should refer them to article(s) talking about the
1763+ * different problems that it could cause. So should `git
1764+ * survey` just print the number and (implicitly) refer them to
1765+ * the man page (chapter/verse) or to a tool that will interpret
1766+ * the number and explain it?
1767+ *
1768+ * [] Alternatively, should `git survey` do that analysis too and
1769+ * just print footnotes for each large number?
1770+ *
1771+ * [] The computation of the raw survey JSON data can take HOURS on
1772+ * a very large repo (like Windows), so I'm wondering if we
1773+ * want to keep the opinion portion separate.
1774+ *
1775+ * [] In addition to opinions based on the static data, I would like
1776+ * to dump the JSON results (or the Trace2 telemetry) into a DB and
1777+ * aggregate it with other users.
1778+ *
1779+ * Granted, they should all see the same DAG and the same set of
1780+ * reachable objects, but we could average across all datasets
1781+ * generated on a particular date and detect outlier users.
1782+ *
1783+ * [] Maybe someone cloned from the `_full` endpoint rather than
1784+ * the limited refs endpoint.
1785+ *
1786+ * [] Maybe that user is having problems with repacking / GC /
1787+ * maintenance without knowing it.
1788+ *
1789+ * [] I'd also like to dump use the DB to compare survey datasets over
1790+ * a time. How fast is their repository growing and in what ways?
1791+ *
1792+ * [] I'd rather have the delta analysis NOT be inside `git
1793+ * survey`, so it makes sense to consider having all of it in a
1794+ * post-process step.
1795+ *
1796+ * [] Another reason to put the opinion analysis in a post-process
1797+ * is that it would be easier to generate plots on the data tables.
1798+ * Granted, we can get plots from telemetry, but a stand-alone user
1799+ * could run the JSON thru python or jq or something and generate
1800+ * something nicer than ASCII-art and it could handle cross-referencing
1801+ * and hyperlinking to helpful information on each issue.
1802+ *
1803+ * [] I think there are several classes of data that we can report on:
1804+ *
1805+ * [] The "inherit repo properties", such as the shape and size of
1806+ * the DAG -- these should be universal in each enlistment.
1807+ *
1808+ * [] The "ODB lived in properties", such as the efficiency
1809+ * of the repack and things like partial and shallow clone.
1810+ * These will vary, but indicate health of the ODB.
1811+ *
1812+ * [] The "index related properties", such as sparse-checkout,
1813+ * sparse-index, cache-tree, untracked-cache, fsmonitor, and
1814+ * etc. These will also vary, but are more like knobs for
1815+ * the user to adjust.
1816+ *
1817+ * [] I want to compare these with Matt's "dimensions of scale"
1818+ * notes and see if there are other pieces of data that we
1819+ * could compute/consider.
1820+ *
17371821 */
0 commit comments