[gmaxwell@argonaut src]$ ./bitcoin-cli getblockstats 101
{
  "avgfee": 0,
  "avgfeerate": 0,
  "avgtxsize": 0,
  "blockhash": "00000000b69bd8e4dc60580117617a466d5c76ada85fb7b87e9baea01f9d9984",
  "feerate_percentiles": [
    0,
    0,
    0,
    0,
    0
  ],
  "height": 101,
  "ins": 0,
  "maxfee": 0,
  "maxfeerate": 0,
  "maxtxsize": 0,
  "medianfee": 0,
  "mediantime": 1231657185,
  "mediantxsize": 0,
  "minfee": 0,
  "minfeerate": 0,
  "mintxsize": 0,
  "outs": 1,
  "subsidy": 5000000000,
  "swtotal_size": 0,
  "swtotal_weight": 0,
  "swtxs": 0,
  "time": 1231661741,
  "total_out": 0,
  "total_size": 0,
  "total_weight": 0,
  "totalfee": 0,
  "txs": 1,
  "utxo_increase": 1,
  "utxo_size_inc": 117
}
[gmaxwell@argonaut src]$ ./bitcoin-cli getblockstats 100000
error code: -8
error message:
One or more of the selected stats requires -txindex enabled

Stats that require txindex should always fail if txindex isn't enabled and the stat is requested, and those stats should not be offered by default.

Also, although the help says it will accept a '1. "hash_or_height"     (string or numeric, required) The block hash or height of the target block', that doesn't seem to work regardless of how I quote it.

[gmaxwell@argonaut src]$ ./bitcoin-cli getblockstats "0000000000000000001b98c07fca289e1ca3358aeabdcca9b7f7ba704d83a3d4"
error: Error parsing JSON:0000000000000000001b98c07fca289e1ca3358aeabdcca9b7f7ba704d83a3d4



"\nResult:\n"
            "{\n"
            "  \"bestblock\":  \"hash\",    (string) The hash of the block at the tip of the chain\n"
            "  \"confirmations\" : n,       (numeric) The number of confirmations\n"
            "  \"value\" : x.xxx,           (numeric) The transaction value in " + CURRENCY_UNIT + "\n"
            "  \"scriptPubKey\" : {         (json object)\n"
            "     \"asm\" : \"code\",       (string) \n"
            "     \"hex\" : \"hex\",        (string) \n"
            "     \"reqSigs\" : n,          (numeric) Number of required signatures\n"
            "     \"type\" : \"pubkeyhash\", (string) The type, eg pubkeyhash\n"
            "     \"addresses\" : [          (array of string) array of bitcoin addresses\n"
            "        \"address\"     (string) bitcoin address\n"
            "        ,...\n"
            "     ]\n"
            "  },\n"
            "  \"coinbase\" : true|false   (boolean) Coinbase or not\n"
            "}\n"
            "\nExamples:\n"
            "\nGet unspent transactions\n"
            + HelpExampleCli("listunspent", "") +
            "\nView the details\n"
            + HelpExampleCli("gettxout", "\"txid\" 1") +
            "\nAs a JSON-RPC call\n"
            + HelpExampleRpc("gettxout", "\"txid\", 1")
        );
    LOCK(cs_main);
    UniValue ret(UniValue::VOBJ);
    uint256 hash(ParseHashV(request.params[0], "txid"));
    int n = request.params[1].get_int();
    COutPoint out(hash, n);