inserita modalità test REDIS x salvataggio hash e recupero (X MP/IO e checkStato)
This commit is contained in:
@@ -162,7 +162,7 @@
|
||||
</site>
|
||||
<site name="MP-IO" id="2">
|
||||
<application path="/" applicationPool="Clr4IntegratedAppPool">
|
||||
<virtualDirectory path="/" physicalPath="C:\Users\samuele.steamw\Documents\VisualStudioProject\MoonPro_dotnet\MP-IO" />
|
||||
<virtualDirectory path="/" physicalPath="C:\Users\samuele\Documents\VisualStudioProjects\MoonPro_dotnet\MP-IO" />
|
||||
</application>
|
||||
<bindings>
|
||||
<binding protocol="http" bindingInformation="*:64103:localhost" />
|
||||
@@ -170,7 +170,7 @@
|
||||
</site>
|
||||
<site name="MP-Admin" id="3">
|
||||
<application path="/" applicationPool="Clr4IntegratedAppPool">
|
||||
<virtualDirectory path="/" physicalPath="C:\Users\samuele.steamw\Documents\VisualStudioProject\MoonPro_dotnet\MP-Admin" />
|
||||
<virtualDirectory path="/" physicalPath="C:\Users\samuele\Documents\VisualStudioProjects\MoonPro_dotnet\MP-Admin" />
|
||||
</application>
|
||||
<bindings>
|
||||
<binding protocol="http" bindingInformation="*:56734:localhost" />
|
||||
@@ -178,7 +178,7 @@
|
||||
</site>
|
||||
<site name="MoonProTablet" id="4">
|
||||
<application path="/" applicationPool="Clr4IntegratedAppPool">
|
||||
<virtualDirectory path="/" physicalPath="C:\Users\samuele.steamw\Documents\VisualStudioProject\MoonPro_dotnet\MP-Tablet" />
|
||||
<virtualDirectory path="/" physicalPath="C:\Users\samuele\Documents\VisualStudioProjects\MoonPro_dotnet\MP-Tablet" />
|
||||
</application>
|
||||
<bindings>
|
||||
<binding protocol="http" bindingInformation="*:56739:localhost" />
|
||||
@@ -194,7 +194,7 @@
|
||||
</site>
|
||||
<site name="MP-MON" id="6">
|
||||
<application path="/" applicationPool="Clr4IntegratedAppPool">
|
||||
<virtualDirectory path="/" physicalPath="C:\Users\samuele.steamw\Documents\VisualStudioProject\MoonPro_dotnet\MP-MON" />
|
||||
<virtualDirectory path="/" physicalPath="C:\Users\samuele\Documents\VisualStudioProjects\MoonPro_dotnet\MP-MON" />
|
||||
</application>
|
||||
<bindings>
|
||||
<binding protocol="http" bindingInformation="*:56580:localhost" />
|
||||
@@ -202,7 +202,7 @@
|
||||
</site>
|
||||
<site name="MP" id="7">
|
||||
<application path="/" applicationPool="Clr4IntegratedAppPool">
|
||||
<virtualDirectory path="/" physicalPath="C:\Users\samuele.steamw\Documents\VisualStudioProject\MoonPro_dotnet\MP" />
|
||||
<virtualDirectory path="/" physicalPath="C:\Users\samuele\Documents\VisualStudioProjects\MoonPro_dotnet\MP" />
|
||||
</application>
|
||||
<bindings>
|
||||
<binding protocol="http" bindingInformation="*:2809:localhost" />
|
||||
@@ -218,7 +218,7 @@
|
||||
</site>
|
||||
<site name="MP-Site(1)" id="9">
|
||||
<application path="/" applicationPool="Clr4IntegratedAppPool">
|
||||
<virtualDirectory path="/" physicalPath="C:\Users\samuele.steamw\Documents\VisualStudioProject\MoonPro_dotnet\MP-Site" />
|
||||
<virtualDirectory path="/" physicalPath="C:\Users\samuele\Documents\VisualStudioProjects\MoonPro_dotnet\MP-Site" />
|
||||
</application>
|
||||
<bindings>
|
||||
<binding protocol="http" bindingInformation="*:54807:localhost" />
|
||||
|
||||
+158
-61
@@ -1,71 +1,168 @@
|
||||
using MapoDb;
|
||||
using SteamWare;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace MP_IO.Controllers
|
||||
{
|
||||
public class BENCHController : Controller
|
||||
public class BENCHController : Controller
|
||||
{
|
||||
// GET: IOB (è un check alive)
|
||||
public string Index()
|
||||
{
|
||||
// GET: IOB (è un check alive)
|
||||
public string Index()
|
||||
{
|
||||
return "OK";
|
||||
}
|
||||
|
||||
// disabilitato: non vale la pena
|
||||
//// GET: IOB/enabled/5 - tenuta in cache per 5 sec...
|
||||
//[OutputCache(Duration = 5, VaryByParam = "id")]
|
||||
|
||||
// GET: BENCH/DB/1000
|
||||
public string DB(int? id)
|
||||
{
|
||||
string answ = "ND";
|
||||
// se id nullo --> KO!
|
||||
if (id == null)
|
||||
{
|
||||
answ = "KO";
|
||||
}
|
||||
else
|
||||
{
|
||||
int numRep = 0;
|
||||
Int32.TryParse(id.ToString(), out numRep);
|
||||
try
|
||||
{
|
||||
answ = MapoDb.MapoDb.obj.benchReadTI("DB", numRep);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore in BENCH/DB{0}{1}", Environment.NewLine, exc));
|
||||
answ = "NO";
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
// GET: BENCH/RED/1000
|
||||
public string RED(int? id)
|
||||
{
|
||||
string answ = "ND";
|
||||
// se id nullo --> KO!
|
||||
if (id == null)
|
||||
{
|
||||
answ = "KO";
|
||||
}
|
||||
else
|
||||
{
|
||||
int numRep = 0;
|
||||
Int32.TryParse(id.ToString(), out numRep);
|
||||
try
|
||||
{
|
||||
answ = MapoDb.MapoDb.obj.benchReadTI("RED", numRep);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore in BENCH/RED{0}{1}", Environment.NewLine, exc));
|
||||
answ = "NO";
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
return "OK";
|
||||
}
|
||||
|
||||
// GET: BENCH/DB/1000
|
||||
public string DB(int? id)
|
||||
{
|
||||
string answ = "ND";
|
||||
// se id nullo --> KO!
|
||||
if (id == null)
|
||||
{
|
||||
answ = "KO";
|
||||
}
|
||||
else
|
||||
{
|
||||
int numRep = 0;
|
||||
Int32.TryParse(id.ToString(), out numRep);
|
||||
try
|
||||
{
|
||||
answ = MapoDb.MapoDb.obj.benchReadTI("DB", numRep);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore in BENCH/DB{0}{1}", Environment.NewLine, exc));
|
||||
answ = "NO";
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
// GET: BENCH/RED/1000
|
||||
public string RED(int? id)
|
||||
{
|
||||
string answ = "ND";
|
||||
// se id nullo --> KO!
|
||||
if (id == null)
|
||||
{
|
||||
answ = "KO";
|
||||
}
|
||||
else
|
||||
{
|
||||
int numRep = 0;
|
||||
Int32.TryParse(id.ToString(), out numRep);
|
||||
try
|
||||
{
|
||||
answ = MapoDb.MapoDb.obj.benchReadTI("RED", numRep);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore in BENCH/RED{0}{1}", Environment.NewLine, exc));
|
||||
answ = "NO";
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
// GET BENCH/RSETUP/100
|
||||
public string RSETUP(int? id)
|
||||
{
|
||||
string answ = "ND";
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
// se id nullo --> KO!
|
||||
if (id == null)
|
||||
{
|
||||
answ = "KO";
|
||||
}
|
||||
else
|
||||
{
|
||||
string chiave;
|
||||
KeyValuePair<string, string>[] valori = new KeyValuePair<string, string>[2];
|
||||
try
|
||||
{
|
||||
// svuoto i precedenti hash... CICLO!
|
||||
for (int i = 0; i < id; i++)
|
||||
{
|
||||
chiave = string.Format("test:{0}", i);
|
||||
memLayer.ML.redDelKey(chiave);
|
||||
}
|
||||
// recupero tutti i record della tabella
|
||||
|
||||
// salvo il datasetet come insieme di hash in redis...
|
||||
for (int i = 0; i < id; i++)
|
||||
{
|
||||
chiave = string.Format("test:{0}", i);
|
||||
valori[0] = new KeyValuePair<string, string>("numero", i.ToString());
|
||||
valori[1] = new KeyValuePair<string, string>("doppio", (i * 2).ToString());
|
||||
memLayer.ML.redSaveHash(chiave, valori);
|
||||
}
|
||||
answ = "OK";
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
stopWatch.Stop();
|
||||
// Get the elapsed time as a TimeSpan value.
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
// accodo tempo!
|
||||
answ = string.Format("Elapsed: {0}ms", ts.TotalMilliseconds);
|
||||
// ritorno
|
||||
return answ;
|
||||
}
|
||||
// GET BENCH/RSH/100
|
||||
public string RSH(int? id)
|
||||
{
|
||||
string answ = "ND";
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
// se id nullo --> KO!
|
||||
if (id == null)
|
||||
{
|
||||
answ = "KO";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = "";
|
||||
string chiave;
|
||||
KeyValuePair<string, string>[] valori = new KeyValuePair<string, string>[2];
|
||||
try
|
||||
{
|
||||
//// svuoto i precedenti hash... CICLO!
|
||||
//for (int i = 0; i < 1000; i++)
|
||||
//{
|
||||
// chiave = string.Format("test:{0}", i);
|
||||
// memLayer.ML.redDelKey(chiave);
|
||||
//}
|
||||
//// recupero tutti i record della tabella
|
||||
|
||||
//// salvo il datasetet come insieme di hash in redis...
|
||||
//for (int i = 0; i < 1000; i++)
|
||||
//{
|
||||
// chiave = string.Format("test:{0}", i);
|
||||
// valori[0] = new KeyValuePair<string, string>("numero", i.ToString());
|
||||
// valori[1] = new KeyValuePair<string, string>("doppio", (i * 2).ToString());
|
||||
// memLayer.ML.redSaveHash(chiave, valori);
|
||||
//}
|
||||
// ora restituisco record completo dell'hash con ID indicato
|
||||
chiave = string.Format("test:{0}", id);
|
||||
valori = memLayer.ML.redGetHash(chiave);
|
||||
foreach (var item in valori)
|
||||
{
|
||||
answ += string.Format("{0}|{1}<br/>", item.Key, item.Value);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
stopWatch.Stop();
|
||||
// Get the elapsed time as a TimeSpan value.
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
// accodo tempo!
|
||||
answ += string.Format("<hr/>Elapsed: {0}ms", ts.TotalMilliseconds);
|
||||
// ritorno
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
}
|
||||
+1503
-1499
File diff suppressed because it is too large
Load Diff
+20
@@ -0,0 +1,20 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2007 James Newton-King
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
BIN
Binary file not shown.
+8555
File diff suppressed because it is too large
Load Diff
BIN
Binary file not shown.
+10467
File diff suppressed because it is too large
Load Diff
+116
@@ -0,0 +1,116 @@
|
||||
param($installPath, $toolsPath, $package, $project)
|
||||
|
||||
# open json.net splash page on package install
|
||||
# don't open if json.net is installed as a dependency
|
||||
|
||||
try
|
||||
{
|
||||
$url = "http://www.newtonsoft.com/json/install?version=" + $package.Version
|
||||
$dte2 = Get-Interface $dte ([EnvDTE80.DTE2])
|
||||
|
||||
if ($dte2.ActiveWindow.Caption -eq "Package Manager Console")
|
||||
{
|
||||
# user is installing from VS NuGet console
|
||||
# get reference to the window, the console host and the input history
|
||||
# show webpage if "install-package newtonsoft.json" was last input
|
||||
|
||||
$consoleWindow = $(Get-VSComponentModel).GetService([NuGetConsole.IPowerConsoleWindow])
|
||||
|
||||
$props = $consoleWindow.GetType().GetProperties([System.Reflection.BindingFlags]::Instance -bor `
|
||||
[System.Reflection.BindingFlags]::NonPublic)
|
||||
|
||||
$prop = $props | ? { $_.Name -eq "ActiveHostInfo" } | select -first 1
|
||||
if ($prop -eq $null) { return }
|
||||
|
||||
$hostInfo = $prop.GetValue($consoleWindow)
|
||||
if ($hostInfo -eq $null) { return }
|
||||
|
||||
$history = $hostInfo.WpfConsole.InputHistory.History
|
||||
|
||||
$lastCommand = $history | select -last 1
|
||||
|
||||
if ($lastCommand)
|
||||
{
|
||||
$lastCommand = $lastCommand.Trim().ToLower()
|
||||
if ($lastCommand.StartsWith("install-package") -and $lastCommand.Contains("newtonsoft.json"))
|
||||
{
|
||||
$dte2.ItemOperations.Navigate($url) | Out-Null
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
# user is installing from VS NuGet dialog
|
||||
# get reference to the window, then smart output console provider
|
||||
# show webpage if messages in buffered console contains "installing...newtonsoft.json" in last operation
|
||||
|
||||
$instanceField = [NuGet.Dialog.PackageManagerWindow].GetField("CurrentInstance", [System.Reflection.BindingFlags]::Static -bor `
|
||||
[System.Reflection.BindingFlags]::NonPublic)
|
||||
|
||||
$consoleField = [NuGet.Dialog.PackageManagerWindow].GetField("_smartOutputConsoleProvider", [System.Reflection.BindingFlags]::Instance -bor `
|
||||
[System.Reflection.BindingFlags]::NonPublic)
|
||||
|
||||
if ($instanceField -eq $null -or $consoleField -eq $null) { return }
|
||||
|
||||
$instance = $instanceField.GetValue($null)
|
||||
|
||||
if ($instance -eq $null) { return }
|
||||
|
||||
$consoleProvider = $consoleField.GetValue($instance)
|
||||
if ($consoleProvider -eq $null) { return }
|
||||
|
||||
$console = $consoleProvider.CreateOutputConsole($false)
|
||||
|
||||
$messagesField = $console.GetType().GetField("_messages", [System.Reflection.BindingFlags]::Instance -bor `
|
||||
[System.Reflection.BindingFlags]::NonPublic)
|
||||
if ($messagesField -eq $null) { return }
|
||||
|
||||
$messages = $messagesField.GetValue($console)
|
||||
if ($messages -eq $null) { return }
|
||||
|
||||
$operations = $messages -split "=============================="
|
||||
|
||||
$lastOperation = $operations | select -last 1
|
||||
|
||||
if ($lastOperation)
|
||||
{
|
||||
$lastOperation = $lastOperation.ToLower()
|
||||
|
||||
$lines = $lastOperation -split "`r`n"
|
||||
|
||||
$installMatch = $lines | ? { $_.StartsWith("------- installing...newtonsoft.json ") } | select -first 1
|
||||
|
||||
if ($installMatch)
|
||||
{
|
||||
$dte2.ItemOperations.Navigate($url) | Out-Null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
try
|
||||
{
|
||||
$pmPane = $dte2.ToolWindows.OutputWindow.OutputWindowPanes.Item("Package Manager")
|
||||
|
||||
$selection = $pmPane.TextDocument.Selection
|
||||
$selection.StartOfDocument($false)
|
||||
$selection.EndOfDocument($true)
|
||||
|
||||
if ($selection.Text.StartsWith("Attempting to gather dependencies information for package 'Newtonsoft.Json." + $package.Version + "'"))
|
||||
{
|
||||
# don't show on upgrade
|
||||
if (!$selection.Text.Contains("Removed package"))
|
||||
{
|
||||
$dte2.ItemOperations.Navigate($url) | Out-Null
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
# stop potential errors from bubbling up
|
||||
# worst case the splash page won't open
|
||||
}
|
||||
}
|
||||
|
||||
# still yolo
|
||||
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
BIN
Binary file not shown.
+6650
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user