forked from PelicanPlatform/pelican
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request PelicanPlatform#1039 from CannonLock/add-cache-page
Add Cache Webpage
- Loading branch information
Showing
12 changed files
with
587 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/*************************************************************** | ||
* | ||
* Copyright (C) 2024, Pelican Project, Morgridge Institute for Research | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you | ||
* may not use this file except in compliance with the License. You may | ||
* obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
***************************************************************/ | ||
|
||
import {Box, Tooltip} from "@mui/material"; | ||
|
||
import {Sidebar} from "@/components/layout/Sidebar"; | ||
import Link from "next/link"; | ||
import Image from "next/image"; | ||
import PelicanLogo from "@/public/static/images/PelicanPlatformLogo_Icon.png"; | ||
import IconButton from "@mui/material/IconButton"; | ||
import BuildIcon from "@mui/icons-material/Build"; | ||
import Main from "@/components/layout/Main"; | ||
|
||
export const metadata = { | ||
title: 'Pelican Cache', | ||
description: 'Software designed to make data distribution easy', | ||
} | ||
|
||
export default function RootLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode | ||
}) { | ||
return ( | ||
<Box display={"flex"} flexDirection={"row"}> | ||
<Sidebar> | ||
<Link href={"/"}> | ||
<Image | ||
src={PelicanLogo} | ||
alt={"Pelican Logo"} | ||
width={36} | ||
height={36} | ||
/> | ||
</Link> | ||
<Box pt={1}> | ||
<Tooltip title={"Config"} placement={"right"}> | ||
<Link href={"/config/"}> | ||
<IconButton> | ||
<BuildIcon/> | ||
</IconButton> | ||
</Link> | ||
</Tooltip> | ||
</Box> | ||
</Sidebar> | ||
<Main> | ||
{children} | ||
</Main> | ||
</Box> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
/*************************************************************** | ||
* | ||
* Copyright (C) 2023, Pelican Project, Morgridge Institute for Research | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you | ||
* may not use this file except in compliance with the License. You may | ||
* obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
***************************************************************/ | ||
|
||
"use client" | ||
|
||
import {Box, Grid, Typography} from "@mui/material"; | ||
|
||
import RateGraph from "@/components/graphs/RateGraph"; | ||
import StatusBox from "@/components/StatusBox"; | ||
import {DataExportTable} from "@/components/DataExportTable"; | ||
import {DataPoint, TimeDuration} from "@/components/graphs/prometheus"; | ||
import FederationOverview from "@/components/FederationOverview"; | ||
import LineGraph from "@/components/graphs/LineGraph"; | ||
|
||
export default function Home() { | ||
|
||
return ( | ||
<Box width={"100%"}> | ||
<Grid container spacing={2}> | ||
<Grid item xs={12} lg={4}> | ||
<Typography variant="h4" mb={2}>Status</Typography> | ||
<StatusBox/> | ||
</Grid> | ||
<Grid item xs={12} lg={4}> | ||
<Typography variant={"h4"} component={"h2"} mb={2}>Data Exports</Typography> | ||
<Box sx={{borderRadius: 2, overflow: "hidden"}}> | ||
<DataExportTable/> | ||
</Box> | ||
</Grid> | ||
<Grid item xs={12} lg={4}> | ||
<FederationOverview/> | ||
</Grid> | ||
<Grid item xs={12} lg={6}> | ||
<Box sx={{backgroundColor: "#F6F6F6", borderRadius: "1rem"}} p={2}> | ||
<Typography variant="h4" mb={1}>Storage</Typography> | ||
<Box minHeight={"200px"}> | ||
<LineGraph | ||
duration={TimeDuration.fromString("7d")} | ||
resolution={TimeDuration.fromString("3h")} | ||
metrics={['xrootd_storage_volume_bytes{ns="/cache",server_type="cache",type="total"}', 'xrootd_storage_volume_bytes{ns="/cache",server_type="cache",type="free"}']} | ||
boxProps={{ | ||
maxHeight:"400px", | ||
flexGrow:1, | ||
justifyContent:"center", | ||
display:"flex", | ||
bgcolor:"white", | ||
borderRadius:2 | ||
}} | ||
options={{ | ||
scales: { | ||
x: { | ||
type: 'time', | ||
time: { | ||
round: 'second', | ||
minUnit: 'minute' | ||
} | ||
} | ||
}, | ||
plugins: { | ||
zoom: { | ||
zoom: { | ||
drag: { | ||
enabled: true, | ||
}, | ||
mode: 'x', | ||
// TODO - Implement smart update on zoom: onZoom: (chart) => console.log(chart) | ||
}, | ||
}, | ||
}, | ||
}} | ||
datasetOptions={[ | ||
{label: "Total Storage (Gigabytes)", borderColor: "#000000"}, | ||
{label: "Free Storage (Gigabytes)", borderColor: "#54ff80"} | ||
]} | ||
datasetTransform={(dataset) => { | ||
dataset.data = dataset.data.map(p => { | ||
let {x, y} = p as DataPoint | ||
y = y / (10**9) | ||
return {x: x, y: y} | ||
}) | ||
|
||
return dataset | ||
}} | ||
/> | ||
</Box> | ||
</Box> | ||
</Grid> | ||
<Grid item xs={12} lg={6}> | ||
<Box sx={{backgroundColor: "#F6F6F6", borderRadius: "1rem"}} p={2}> | ||
<Typography variant="h4" mb={1}>Transfer Rate</Typography> | ||
<Box minHeight={"200px"}> | ||
<RateGraph | ||
rate={TimeDuration.fromString("3h")} | ||
duration={TimeDuration.fromString("7d")} | ||
resolution={TimeDuration.fromString("3h")} | ||
metrics={['xrootd_server_bytes{direction="rx"}', 'xrootd_server_bytes{direction="tx"}']} | ||
boxProps={{ | ||
maxHeight:"400px", | ||
flexGrow:1, | ||
justifyContent:"center", | ||
display:"flex", | ||
bgcolor:"white", | ||
borderRadius:2 | ||
}} | ||
options={{ | ||
scales: { | ||
x: { | ||
type: 'time', | ||
time: { | ||
round: 'second', | ||
minUnit: 'minute' | ||
} | ||
} | ||
}, | ||
plugins: { | ||
zoom: { | ||
zoom: { | ||
drag: { | ||
enabled: true, | ||
}, | ||
mode: 'x', | ||
// TODO - Implement smart update on zoom: onZoom: (chart) => console.log(chart) | ||
}, | ||
}, | ||
}, | ||
}} | ||
datasetOptions={[ | ||
{label: "Bytes Received (Bps)", borderColor: "#0071ff"}, | ||
{label: "Bytes Sent (Bps)", borderColor: "#54ff80"} | ||
]} | ||
/> | ||
</Box> | ||
</Box> | ||
</Grid> | ||
</Grid> | ||
</Box> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,8 +58,6 @@ const FederationOverview = () => { | |
return | ||
} | ||
|
||
console.log(config) | ||
|
||
return ( | ||
|
||
<Box> | ||
|
Oops, something went wrong.