Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions scripts/migrate.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const fetchDocs = require('./utils/migrate/fetch-docs');
const fetchDocCount = require('./utils/migrate/fetch-doc-count');
const createDirectories = require('./utils/migrate/create-directories');
const convertFile = require('./utils/migrate/convert-file');
const createIndexPages = require('./utils/migrate/create-index-pages');
Expand Down Expand Up @@ -28,6 +29,7 @@ const run = async () => {
const files = await all(docs, toVFile).then((files) =>
files.sort((a, b) => a.path.localeCompare(b.path))
);
const docCount = await fetchDocCount(files);

logger.normal('Creating directories');
createDirectories(files);
Expand Down
41 changes: 41 additions & 0 deletions scripts/utils/migrate/fetch-doc-count.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
const fetch = require('node-fetch');
require('dotenv').config();
const { writeSync } = require('to-vfile');
const vfile = require('vfile');

const logger = require('../logger');

const fetchDocCount = async (files) => {
const url = 'https://docs-dev.newrelic.com/api/migration/content/count';
try {
const resp = await fetch(url, {
headers: {
'Content-Type': 'application/json',
'X-Phpshield-Key-Disable': process.env.ACQUIA_DEV_PHP_SHIELD_KEY,
},
});
const result = await resp.json();

const totalCount = parseInt(result.docs[0].count.all);
const migratedCount = files.length;

writeSync(
vfile({
contents: JSON.stringify(
{
migratedCount,
totalCount,
},
null,
2
),
path: `${process.cwd()}/src/data/count`,
extname: '.json',
})
);
} catch {
logger.error(`Error, could not fetch number of docs`);
}
};

module.exports = fetchDocCount;
4 changes: 4 additions & 0 deletions src/announcements/beta-banner.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ startDate: 2020-09-24
endDate: 2021-12-31
---

import data from '../data/count.json';

# See the future of docs.newrelic.com!

You're on the experimental version of our new docs site. We're moving the docs to the same open-source architecture as [developer.newrelic.com](https://developer.newrelic.com) and [opensource.newrelic.com](https://opensource.newrelic.com)—it'll be faster, more flexible, and open for your contributions. If you have feedback, [file an issue](https://github.com/newrelic/docs-website/issues) in our repo.

This experimental version doesn't contain all our content, and not everything is stable. If you're looking to read our docs, go to [docs.newrelic.com](https://docs.newrelic.com).

So far, we have migrated **{data.migratedCount}** out of **{data.totalCount}** content pages!
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ To get the metric values for your app, copy the values from the **Metric Names**

After reviewing the **Response** section, you can continue making adjustments, and select **Send Request** again. For example:

* To specify a [time range](/docs/apm/apis/api-v2-examples/specifying-time-range-api-v2) for the metric timeslice data, fill the `from` and `to` values, or use the [diamond](/docs/apm/apis/api-explorer-v2/parts-api-explorer#diamond) ![icon-api-diamond](./images/icon-api-diamond.png "icon-api-diamond") .
* To specify a [time range](/docs/apm/apis/api-v2-examples/specifying-time-range-api-v2) for the metric timeslice data, fill the `from` and `to` values, or use the [diamond](/docs/apm/apis/api-explorer-v2/parts-api-explorer#diamond) ![icon-api-diamond](http://newrelicdev.prod.acquia-sites.com/sites/default/files/thumbnails/image/icon-api-diamond.png "icon-api-diamond") .
* To create an [average](/docs/apm/apis/requirements/calculating-average-metric-values-summarize) of the data over the time range, set `summarize` to `true`. Or, to keep the data for each time period for the range you have specified, leave `summarize` blank.

## View other REST API data
Expand Down
4 changes: 4 additions & 0 deletions src/data/count.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"migratedCount": 584,
"totalCount": 5791
}